Do we want functions to act as properties, or merely omit parens for ufcs/chaining?
FG
home at fgda.pl
Tue Jan 29 05:50:53 PST 2013
On 2013-01-29 13:13, eles wrote:
> I also find
>
> writeln = "hello"
>
> very confusing. Is that a variable assignment, btw? What do you think?
To me this is just a lousy party trick... pulling a rabbit out of the hat. ;)
Makes absolutely no sense, because writeln doesn't store "hello" in its state -
there is no way to read it. Maybe it's a limited mindset, but to me properties
should be read-only or read-write, but not write-only.
On the other hand, if it was a hypothetical property (let's call it
"lastDebugMessage"), that stores and returns the string, while also printing it
as a side-effect, then it could be acceptable (although this particular example
is of limited practical value).
More information about the Digitalmars-d
mailing list