Revised RFC on range design for D2
Sergey Gromov
snake.scaly at gmail.com
Fri Sep 12 07:22:49 PDT 2008
Bill Baxter <wbaxter at gmail.com> wrote:
> But I do have some suggestions nonetheless! Marked with ==> below.
>
> -- Universal --
> r.done
> r.init
>
> --- Input : Universal ---
> e=r.head
> e=r.next
> r1=r.release ==> r.transfer? Release sounds like ref counting (e.g. in COM)
> Also seems like r.transfer(r1) could make
> implementation more efficient.
> Or perhaps make it a .swap like STL. Maybe
> you have something against .swap?
>
> -- Output : Universal --
> r.put(e)
>
> -- Forward : Input, (optional) Output --
> r1 = r
> r.head = e
> t=r.after(s)
>
> -- Bidirectional : Forward --
> e = r.toe
> r.toe = e
> r.reduce ==> r.retreat -- aka "pull back"
> t = r.before(s)
>
> -- Random access : Bidirectional --
> l = r.length
> e = r[n]
> r[n] = e
> r1 = r[n1..n2]
> ------------
>
> Just those two!
I've got a bit of insight! XD
-- Common
r.empty
-- InOut
v = r.next; => T R.next();
r.next = v; => T R.next(T v);
-- Forward: InOut, copyable
v = r.tip
r.tip = v
r1 = r.before(s)
r1 = r.after(s)
-- Bidir: Forward
v = r.prev
r.prev = v
v = r.toe
r.toe = v
-- Random: Bidir
no changes
prev() seems very misleading, otherwise I like it.
More information about the Digitalmars-d-announce
mailing list