[Feature Request] Adding to D lang "set" built-in
Steven Schveighoffer
schveiguy at yahoo.com
Mon May 7 04:57:39 PDT 2012
On Sat, 05 May 2012 13:14:27 -0400, bioinfornatics
<bioinfornatics at fedoraproject.org> wrote:
> Dear, i hope i will got some answer from druntime/phobos dev .
> A set is an array of unique element:
>>>> set( 1, 5, 7, 1, 7)
> give this array => [1, 5, 7]
>
> Currently in D the hack it is to use an associative array with any
> value.
> byte[size_t] a = [ 1:0, 5:0, 7:0, 1:0, 7:0 ];
>
> then it is easy to have a set in D just add a syntax or a built-in where
> use associative array without using value.
>
> I hope really this little feature and seem really easy to add
>
>
> thanks a lot for your great works
http://www.dsource.org/projects/dcollections
-Steve
More information about the Digitalmars-d
mailing list