Revised RFC on range design for D2

torhu no at spam.invalid
Sun Sep 28 13:23:57 PDT 2008


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.


More information about the Digitalmars-d-announce mailing list