Prototypes (was: Why Strings as Classes?)

Fawzi Mohamed fmohamed at mac.com
Thu Aug 28 04:43:58 PDT 2008


On 2008-08-28 13:33:47 +0200, "Manfred_Nowak" <svv1999 at hotmail.com> said:

> Walter Bright wrote:
> 
>> I invite you to look at the code in internal/aaA.d and do some
>> testing!
> 
> This invitation is a red herring without the offer to change the
> language, because there exists no implementation for AA covering all
> possible use cases.
> 
> The bare minimum to get anything out of fiddling with the
> implemenations for AA is the posibility to use the results of adaptions
> without considerable overhead especially for the declarations. However,
> currenty I do not see any elegant solution, because types of
> implementation of maps are given implicitely.
> 
> At least something like prototyping seems to be necessary:
> 
> |    int[ char[]] map;
> |    Prototype= typeof( map);
> |    Prototype.implementation= MyAA;
> 
> where MyAA is some class type implementing the interface required for
> AA.
> 
> Are you willing to do something in this direction?

I think that the invitation should be read as the possibility to 
experiment with some changes for AA, see their effect, and if 
worthwhile provide them back, so that they can be applied to the 
"official" version.

making the standard version changeable seems just horrible form the 
portability and maintainability and clarity of the code: if the 
standard version is not ok for your use you should explicitly use 
another one, otherwise mixing codes that use two different standard 
versions becomes a nightmare.
On the other hand if you think that you can improve the standard 
version for everybody, changing internal/aaA.d is what you should do...

Fawzi
> 
> -manfred





More information about the Digitalmars-d mailing list