Revised RFC on range design for D2

Chris R. Miller lordsauronthegreat at gmail.com
Sun Sep 28 17:17:54 PDT 2008


torhu wrote:
> Chris R. Miller wrote:
>> torhu wrote:
>>> Using an equals sign to say that assignment syntax is allowed seems 
>>> natural:
>>>
>>> void prop(=int x) { }  // assignment syntax ok
>>> void prop(= int x) { }  // same thing
>>>
>>> Other cases:
>>> void prop(=int x=0) { }  // can called as 'prop;' or 'int z = prop;'
>>> void prop(=int x, int y) { }  // probably syntax error
>>> void prop(=int x, int y=0) { }  // unusual but ok?
>>>
>>>
>>> Functions with no arguments can still be called without parens.
>>
>> My concern is that this could break existing code.  If the presence of 
>> an equals sign allows the use of the property syntax, then suddenly 
>> code needs to be updated that is supposed to be able to be used like a 
>> property.  Perhaps something to explicitly disallow the use of the 
>> property syntax?
> 
> Well, isn't this just for D 2.0?  The implicit property setters could be 
> just deprecated, like volatile recently was, so compiling with -d will 
> make them work again.

D 2.0 isn't so different that every line of code will have to be 
rewritten for it though.  Why force people to have to rewrite more code 
for D2.0 if we aren't sure we have to?

Also, are we considering these properties?

void doFoo() { }

int main() {
      doFoo; // same as doFoo();
}



More information about the Digitalmars-d-announce mailing list