std.experimental.collection.functional.slist
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jun 19 08:27:26 PDT 2015
On 6/19/15 8:01 AM, "Ulrich =?UTF-8?B?S8O8dHRsZXIi?=
<kuettler at gmail.com>" wrote:
> If opAssign is allowed, a major point of functional data structures is
> lost. Client code is so much better if rebinding is off the table.
I have the same instinct but not enough rationale. What would be an
example in favor of the argument?
> On
> the other hand, there is const and immutable... I would still prefer
> properly functional data structures.
>
> In addition, is there a constructor for structural sharing, the
> complement to tail? Along those line:
>
> this(T e, SList rhs)
> {
> if (rhs.root) {
> allocator = rhs.allocator;
> root = allocator.make!Node(e, 1, rhs.root);
> ++rhs.root.count;
> }
> }
Yah, I implemented that to be spelled as value ~ list.
> This is very exciting! Properly typed efficient functional data
> structures! (In my dream, there are clojure's vector, set, map in D.)
> This is just too good.
I can tell I'm pretty excited to hack at it.
Andrei
More information about the Digitalmars-d
mailing list