On 2/3/13 9:17 PM, David Nadlinger wrote:
On Monday, 4 February 2013 at 01:30:49 UTC, Andrei Alexandrescu wrote:
I think most, if not all, detailed rules derive from these.
One does not, the strange special case for taking the address of a
property.
I'd REALLY urge you to explore alternative solutions, such as the one
proposed by Andrej, before introducing an abomination like
distinguishing between "&a" and "&(a)".
Andrej's proposal is nice, but I think you're wrong about this. We're
already there - &a.b means something (a delegate) which is not
decomposable into smaller parts.
There is no way such strange behavior could be explained in a way that
is coherent with the rest of the language.
I disagree.
I found that when you are working on a complex problem and have a
solution that seems to work for everything except a little detail, the
best approach often is to step back a bit and have an entirely fresh
look at that area again, but now taking the rest of your design as a given.
I agree with the general thought.
Introducing a rule by which parenthesizing an expression in a way that
does not change precedence suddenly causes a difference in behavior
certainly wouldn't be among the first ideas coming to my mind this way.
I really think you are wrong about this. Parenthesizing has nothing to
do with this. &a.b is punctuation that creates an indivizible unit.
Andrei