On Sat, Jun 30, 2012 at 6:27 AM, bearophile bearophileh...@lycos.comwrote:
Tobias Pankrath:
But I would generally avoid SList.
It's not good.
And in general linked lists are quite overrated. On modern CPUs it's not
easy to find situations where a linked list is better than a dynamic
Have you had a look at dcollection ?
http://www.dsource.org/projects/dcollections
There is a doubly linked list implementation, with range and cursors
(entities that have iterator functionalities).
On 30-Jun-12 18:25, Andrei Alexandrescu wrote:
On 6/30/12 9:15 AM, Dmitry Olshansky wrote:
On 30-Jun-12 15:35, Tobias Pankrath wrote:
Say I have a forward range (for example, an SList[]). I would like to
create a new range containing only the first 5 elements of that old
range. How can I do
On Saturday, 30 June 2012 at 23:51:42 UTC, Andrei Alexandrescu
wrote:
Yes. But now you're moving the goalposts because many of your
arguments referred to SList.
I'm sorry, that's not what I meant to do. The goal post was not
moved, rather misplaced to begin with. Using SList for making my
On Sunday, 1 July 2012 at 13:22:17 UTC, monarch_dodra wrote:
Something like...
inverseRangeBegin(R big, R small): Creates a range that
begins where big starts, and ends where small starts. R must be
at least bidirectional. small must be included inside big.
From an implementation point of
I've been enjoying my time with D's ranges, but something is
nagging at me: If the range is not random access, then how does
one create a sub-view of that range?
Say I have a forward range (for example, an SList[]). I would
like to create a new range containing only the first 5 elements
of
Say I have a forward range (for example, an SList[]). I would
like to create a new range containing only the first 5 elements
of that old range. How can I do that?
std.algorithm.take.
But I would generally avoid SList.
On Saturday, 30 June 2012 at 11:35:07 UTC, Tobias Pankrath wrote:
std.algorithm.take.
But I would generally avoid SList.
Thanks, but isn't that kind of a crutch solution?
I mean:
1) It creates a new type, so any attempt to use it to modify an
existing range becomes impossible:
void main()
Tobias Pankrath:
But I would generally avoid SList.
It's not good.
And in general linked lists are quite overrated. On modern CPUs
it's not easy to find situations where a linked list is better
than a dynamic array or a chunked array (that is a dynamic array
of pointers to arrays. It's
On 30-Jun-12 15:35, Tobias Pankrath wrote:
Say I have a forward range (for example, an SList[]). I would like to
create a new range containing only the first 5 elements of that old
range. How can I do that?
std.algorithm.take.
But I would generally avoid SList.
Indeed. I'd be hard pressed
On Saturday, 30 June 2012 at 12:27:38 UTC, bearophile wrote:
Tobias Pankrath:
But I would generally avoid SList.
It's not good.
And in general linked lists are quite overrated.
...
Bye,
bearophile
I appreciate the input, which I (mostly) agree with (I still love
list's splice ability,
On 6/30/12 8:24 AM, monarch_dodra wrote:
On Saturday, 30 June 2012 at 11:35:07 UTC, Tobias Pankrath wrote:
std.algorithm.take.
But I would generally avoid SList.
Thanks, but isn't that kind of a crutch solution?
I mean:
1) It creates a new type, so any attempt to use it to modify an
On 6/30/12 7:31 AM, monarch_dodra wrote:
I've been enjoying my time with D's ranges, but something is nagging at
me: If the range is not random access, then how does one create a
sub-view of that range?
Use take or takeExactly.
Say I have a forward range (for example, an SList[]). I would
On 6/30/12 9:15 AM, Dmitry Olshansky wrote:
On 30-Jun-12 15:35, Tobias Pankrath wrote:
Say I have a forward range (for example, an SList[]). I would like to
create a new range containing only the first 5 elements of that old
range. How can I do that?
std.algorithm.take.
But I would
On Saturday, 30 June 2012 at 14:22:06 UTC, Andrei Alexandrescu
wrote:
2) The new range is defined as a fixed length from the
beginning of the
range, as opposed to start and finish points. If I were to
insert new
items into my Slist, the new range would just bump the top
items out of
its
On 6/30/12 11:15 AM, Monarch Dodra wrote:
On Saturday, 30 June 2012 at 14:22:06 UTC, Andrei Alexandrescu wrote:
2) The new range is defined as a fixed length from the beginning of the
range, as opposed to start and finish points. If I were to insert new
items into my Slist, the new range would
16 matches
Mail list logo