Revised RFC on range design for D2
Sergey Gromov
snake.scaly at gmail.com
Fri Sep 12 09:43:20 PDT 2008
Ary Borenszweig <ary at esperanto.org.ar> wrote:
> Two questions:
> - Is it possible to add elements to a range? Suppose a linked list, you
> want to traverse it's elements until a condition is met on an element,
> and then add something after it. Or before it. I see there's "put", but
> it also says "An output range models a one-pass forward writing
> iteration.", so I think it's not the same.
> - The same question applies if you want to delete an element from a range.
The idea is that a container is responsible for mutators, not range.
Therefore you'd have list.insertBefore(range, value). Likewise there'd
be list.remove(range), list.removeBefore(range) and list.removeFirst
(range).
More information about the Digitalmars-d-announce
mailing list