property syntax strawman

Michiel Helvensteijn m.helvensteijn.remove at gmail.com
Mon Aug 3 07:25:02 PDT 2009


Steven Schveighoffer wrote:

> So the poster who started this trail of the thread is assuming that
> 
> t.property.get()
> 
> identifies the property getter directly.  But what if the return type of
> t.property.get() contains a method get()?  Since t.property is an alis for
> t.property.get(), Should t.property.get() map to:
> 
> ...
> 
> That is the ambiguity.

I myself see great value in the ability to access the getter and setter
functions directly. But because of the ambiguity you described, this is
problematic for D.

Andrei sees 'get' and 'set' as nothing more than declaration-side
indications of the getter and setter. Not real functions. In that case, the
ambiguity doesn't exist.

To alleviate possible confusion, it has been suggested that a space be used,
not a dot, between the name of the property and get/set in the declaration.

-- 
Michiel Helvensteijn




More information about the Digitalmars-d mailing list