new DIP5: Properties 2
Michel Fortin
michel.fortin at michelf.com
Tue Jul 28 13:13:40 PDT 2009
On 2009-07-28 10:08:17 -0400, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> said:
> My perception is that there are a few vocal people. The protests have
> been historically against the stupid "writeln = 42" which we must get
> rid of.
For the record, I'm not even bothered by such things. Returning
function pointers and delegates, and types having an opCall can't use
the property syntax for purely syntaxical reasons, this bother me much
more. Then it'd be better to have operator overloading for properties.
And in the last position it'd be that you can write stupid code like
the above.
> I have a dream.
>
> * Parameterless functions still can be called without "()". People will
> realize that it's a prejudice to believe that this impedes code
> understanding, and their eyes and wrists will thank them.
I like calling parameterless functions without "()", but it isn't very
clear what you're doing with some callable return types.
> * The syntax "foo = bar" is rewritten into "foo(bar)" IF AND ONLY IF
> the expression "auto __x = foo, __x = bar" is compilable.
Answered to that one in another thread. I think it's worse than what we
have now.
> * The non-uniformity regarding parameterless functions returning
> parameterless functions is acknowledged but considered minor.
I do consider this minor, but still an annoyance. I don't dislike the
current function/property syntax, I just don't like it as much as I
though I'd do at first.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list