yank unary '+'?

KennyTM~ kennytm at gmail.com
Sun Dec 6 11:58:43 PST 2009


On Dec 7, 09 00:23, Andrei Alexandrescu wrote:
> Is there any good use of unary +? As an aside, Perl programs do use it
> occasionally for syntactic disambiguation :o).
>
> Andrei

Yes, when you want to port the Boost Spirit parser :o) (OK that's an abuse.)

Well the unary + can help to emphasize "it's a positive number", and 
1.0e+10 is already a form of "unary +" (not the operator).

Removing the unary + doesn't lose much, but it doesn't gain much either, 
and with it already present in all other languages, I don't see a good 
reason to change it.



More information about the Digitalmars-d mailing list