[Feature Request] Adding to D lang "set" built-in

Russel Winder russel at winder.org.uk
Sun May 6 23:05:28 PDT 2012


On Sun, 2012-05-06 at 22:53 -0700, Jonathan M Davis wrote:
[...]
> We have RedBlackTree, so we have a set already. What we don't have is a 
> HashSet. However, once the custom allocator stuff has been sorted out, I'd 
> fully expect to have one in std.container along with a variety of other 
> container types which we really should have but don't.

I certainly went immediately to std.container to look for the work set,
map, etc. in some guise. I only posted after finding nothing
appropriate.

I guess the issue here is that maps (aka dictionaries, aka associative
arrays) are in the D language core (as in Python) rather than being is
the library (as in C++). This indicates set should be in the core rather
than in the library.

I wonder if the tradition of exposing HashMap and TreeMap was a
disservice by C++ and Java? Map and Set are programmer level concepts.
Where there are algorithmic issues that require knowing about trees or
has tables then the programmer is not working at the map or set level.

And the programmer has no control over how D's associative arrays work.

And let's not mention Java's LinkedHashMap.  :-)

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120507/1df6b28d/attachment.pgp>


More information about the Digitalmars-d mailing list