DIP23 draft: Fixing properties redux

Johannes Pfau nospam at example.com
Sun Feb 3 07:48:00 PST 2013


Am Sun, 03 Feb 2013 04:40:44 -0800
schrieb Jonathan M Davis <jmdavisProg at gmx.com>:

> On Sunday, February 03, 2013 13:34:14 Jacob Carlborg wrote:
> > On 2013-02-03 09:16, Andrei Alexandrescu wrote:
> > > Walter and I have had a discussion on how to finalize properties.
> > > 
> > > http://wiki.dlang.org/DIP23
> > 
> > What about:
> > 
> > writeln = "asd";
> > 
> > Allowed or not?
> 
> I take it that you didn't read the DIP. At the very beginning of its
> section on "Write properties:"
> 
> -----------
> In order to use the assignment operator "=" property-style, the
> @property annotation MUST be used.
> -----------

There's a example on the page though which contradicts this:

static int x;
ref int fun1() { return x; }
fun1 = 42;




More information about the Digitalmars-d mailing list