Extended Type Design.

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Fri Mar 16 17:36:13 PDT 2007


Bill Baxter wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> sclytrack wrote:
>>>> IMHO (b) should be 'readonly' and (c) should be 'const'.
>>> [snip]
>>>
>>> vote++
>>>
>>>
>>> Keywords
>>> --------
>>>
>>> I also think keywords can be written attached to one another.
>>> Like if you were to really call it "super const" have it called
>>> superconst instead of super_const.
>>
>> Yet you write static const not staticconst; public static not 
>> publicstatic; static if and not staticif; and so on.
>>
>> superconst came up too. But it creates a bad precedent. A healthier 
>> precedent is to synthesize phrases, not new keywords, from the 
>> existing keywords. Think of "static if" or "final switch". Very 
>> beautiful.
>>
>>> It is like the foreach_reverse that we have in D. Why not
>>> call it foreachreverse instead.
>>
>> Probably it's best to call it foreach reverse. It's unambiguous, easy 
>> to parse, does not add new keywords, and continues another nice 
>> precedent set by extern(language) and by scope(exit).
> 
> So you mean foreach(reverse) then?  I do like that!  You're right that 
> it is quite D-like.  Too bad you weren't around back when 
> foreach_reverse was introduced?   ;-)

Possibly even without the parens:

foreach (i ; array) { ... }

foreach reverse (i ; array) { ... }

I have a feeling Walter is unlikely to change that though :o).


Andrei



More information about the Digitalmars-d mailing list