Re:PHP: \ as namespace separator. What were they thinking?
by randallsquared on Sunday October 26, 2008 @02:47PM
(#344476)
> generated code
Not a problem: either the PHP generated is only safe for a particular version, or they can add parenthesis to distinguish the cases.
> to convert stuff to explicit true/false
I suppose. That would seem like a surprising use to me, and would merit an explanatory comment, but given that, it might be better to just explicitly cast ("(bool)$name"), which saves the comment, and only adds four characters over "!!$name".
Re:PHP: \ as namespace separator. What were they thinking?
by qqq on Sunday October 26, 2008 @03:17PM
(#344492)
Every syntax quirk that requires the code generator to do something (e.g. add more parentheses) makes code generation harder.
Re:PHP: \ as namespace separator. What were they thinking?
by randallsquared on Sunday October 26, 2008 @05:36PM
(#344573)
I would naively expect every single expression to be surrounded by parenthesis by default, implemented in the lowest level writeExpression() function or whatever. But I've never written a translator, so...
to convert stuff to explicit true/false