Robustness of the built in associative array
Bruno Medeiros
daiphoenixNO at SPAMlycos.com
Sun Mar 26 18:41:14 PST 2006
Sean Kelly wrote:
>>> 2) Why even keep the builtin AA? With the addition of an opIn()
>>> overload, you could get *exactly* the same functionality from a
>>> library implementation
>>
>> Nope, in fact, you couldn't. The kicker is that the builtin AA uses
>> some syntax
>> that is currently _impossible_ to duplicate in custom types. Eg. the
>> following:
>>
>> # int[int] ii;
>> # ii[10]++;
>
> Yup, not having a bona fide reference type in D is problematic. Though
> you could always use pointers :-p
>
WHOOOA there. "Reference type" is a pretty overloaded term that means
two distinct things, which I hope you already know:
* Reference types (as in vs. value types)
* Reference types or references (as in C++ references)
I don't know any unambiguous terminology for these two terms, there may
not even be one (correct me if wrong). However, nowadays, most of the
time when one says "reference types" it means the first thing (me
inclusive). So please, when you speak of the C++ references please
disambiguate the term. (usually called just "references", although this
is still very close to the other term)
As for you point. Yes, this demonstrates a good usage scenario for a
"C++ reference". Should there be such a feature in D? Or can this
problem be solved in an alternate way? Is the added complexity of this
feature worth it? I don't know I cannot come to a conclusion. :/
--
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list