Eric Brine wrote:
>One could say this is more of a problem with "/" than with "if" expression,
Also a problem with "+", "-", "*" and "<". No, it's a problem with
if-as-expression.
>Which brings me to my point. Would it be bad if "if" expression always
>required leading "+"
Liable to be confusing.
>(last statement of sub or block excepted, of course)?
This makes no sense. I don't see how the special status of the last
statement of a block is at all relevant to if-as-expression.
>Concise existing mechanism providing visual cue of meaning. It has it all.
if-as-expression as you propose it still provides the misleading clue
of ending with "}", and moreover "}" preceded by a statement, which is
unusual for an expression. do{} is misleading in the same way, and I
think we shouldn't repeat the mistake.
Mandatory surrounding parens would be a better cue. Less confusing
(because less unusual) than mandatory unary +, and it makes the end of
the expression look like, er, the end of an expression.
-zefram
Thread Previous
|
Thread Next