Sets yet again :)

Hasan Aljudy hasan.aljudy at gmail.com
Fri Mar 10 18:50:32 PST 2006


Fredrik Olsson wrote:
> Hasan Aljudy skrev:
> 
>> Fredrik Olsson wrote:
> 
> <snip>
> 
>> Just write a set class. It's not /that/ hard.
> 
> 
> That I already have, two implementations: Set and SmallSet, the first 
> using a hash table and the second a bit field for speed.
> 
> But that is sort of not the point, if D did not have arrays I am quite 
> sure no one would suggest "Write an array class", it is how Java and 
> .net have solved it, but it is not the best solution, proved by both 
> Java, C# and others "knows" about arrays anyway.
> Same goes for strings "write a string class", the C++ crowd have settled 
> for that, the D crowd have not, and I think we all feel better off that 
> way.
> 
> My argument is the same with sets, it is such a useful, beautiful and 
> natural part of programming that it should not be treated as a second 
> class citizen in some backwater library.
> 
> // Fredrik

I like the way Java implements String in a class.
If D had a _standard_ array class, I think I'd use it.

C++ std::string just sucks, the whole STL sucks, but that's another issue.

You raise a valid point, but, for D, all we need is a standard Set 
class. It doesn't need to be built in.

If you've writte a set class as you say, submit it to Walter, it might 
end up in phobos!



More information about the Digitalmars-d mailing list