Why I (Still) Won't Use D

Michiel Helvensteijn nomail at please.com
Thu Mar 27 13:35:51 PDT 2008


Walter Bright wrote:

>> So why not allow a library to define what an int[] or int[T] means? This
>> would only work, however, if:
>> 
>> * No clashing implementations can be imported at the same time. (Just
>> like two classes with the same name can't coexist.)
>> * There is a default implementation for which you need no imports.
> 
> Like you suggested, the problem with a library defining how it works is
> that the library would have to be standardized so that code could
> interoperate, and this negates all the advantages of having it be in a
> library.

That's going to be a problem anyway, when people start using library vectors
and maps because of the limitations of standard D containers (the .keys
example was a good one, I think). Especially since D has two widely used,
competing libraries. 

But it can be solved, surely? Just make sure you have functions in the
working referencing environment that can convert from one type to the other
automatically when needed. Sure, this might result in slower code than
forcing people to use the same type everywhere, but that's just
unrealistic.

-- 
Michiel




More information about the Digitalmars-d mailing list