On Saturday, 1 November 2014 at 00:04:18 UTC, Jakob Ovrum wrote:
On Tuesday, 28 October 2014 at 22:44:32 UTC, Freddy wrote:
http://wiki.dlang.org/DIP67
Abstraction over the build-in associative array(one type of range
for containers and another type for dynamic generators).
Plese criticize.

Any examples of what this actually accomplishes? Maybe an example of an algorithm that can do something useful with these primitives? A rationale for why these are the chosen primitives?

As the proposed "associative range" isn't consumable like other ranges, this seems more like a specific kind of *container*, not a *range*; indeed the text of the DIP seems to conflate the concepts, but they are separate by necessity.

Note that opIndex and opBinaryRight are already container primitives (see std.container). There's also the additional relevant primitive `removeKey`. Beyond that though, associative containers could need some more fleshing out in the container concept.

As it is, I think this proposal suffers both from lack of substance and confusing terminology.

The pull request has already been denied. I didn't know about
std.container's definitions.

They can't be consumable, built-in associative arrays overload
foreach(key,value;array) adding input range primitives would
conflict.

Reply via email to