hashed array?

bearophile bearophileHUGS at lycos.com
Mon Nov 12 06:50:47 PST 2012


monarch_dodra:

> I've noticed though it has no built-in "hashed container" for 
> when you just need to store unique elements, but without any 
> specific data associated (lists of names, for example).

They are often named "hash sets". In Python this is a built-in 
type. But in D I think it's better to define such sets as a 
library template in a module to import. This is meant to be in 
Phobos.


> he interface would be mostly the already existing functions of 
> AA (".remove", "in", "rehash()"), plus ".insert" to insert a 
> key.

It also needs some other methods, see:
http://docs.python.org/2/library/sets.html

Bye,
bearophile


More information about the Digitalmars-d mailing list