Kinds of containers
Jacob Carlborg via Digitalmars-d
digitalmars-d at puremagic.com
Sat Oct 24 02:22:37 PDT 2015
On 2015-10-21 13:05, Andrei Alexandrescu wrote:
> 1. Functional containers.
>
> These are immutable; once created, neither their topology nor their
> elements may be observably changed. Manipulating a container entails
> creating an entire new container, often based on an existing container
> (e.g. append takes a container and an element and creates a whole new
> container).
>
> Internally, functional containers take advantage of common substructure
> and immutability to share actual data. The classic resource for defining
> and implementing functional containers is
> http://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504.
Can these be implemented by the user just declaring a regular container
as immutable? The implement will recognize if it's declared as immutable
and adapt.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list