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

Steven Schveighoffer schveiguy at yahoo.com
Mon May 7 06:28:00 PDT 2012


On Mon, 07 May 2012 08:52:56 -0400, David Nadlinger <see at klickverbot.at>  
wrote:

> On Monday, 7 May 2012 at 06:05:47 UTC, Russel Winder wrote:
>> 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.
>
> Some people say that abstracting away big-O complexity should be a  
> capital offense, and I agree (preferably in slightly less drastic words,  
> though). Additionally, a tree-based map is naturally ordered, whereas a  
> hash map is not – for me, that's enough to warrant exposing what seems  
> to be a »detail«, at least in languages like C++ and D.

Yes, I fully agree.

That being said, I think it's also important that some  
functions/structures should not have to care what algorithm is used.   
That's one of the reasons I like having the interface design that  
dcollections uses.

-Steve


More information about the Digitalmars-d mailing list