Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't mind it. Think of it this way – ? is a function from types to types. Given type X as input, it returns the union of X and the type of the null value. Once you start thinking of it as function application, putting the symbol which represents the function before the argument seems a perfectly rational thing to do.


That makes it doubly funny since the real reason is that the parser couldn't handle the other case.

Even a blind php dev...


There's nothing wrong with the lexer or the parser. Avoiding becoming like C, where lexical analysis can't be done without knowing context, is a good thing.

PHP actually once supported this kind of ambiguity (PHP/FI 2.0 ended PHP code with a single > yet also allowed if ($a > $b)), but this wasn't a good idea and resulted from a greatly suboptimal implementation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: