Hacker News new | ask | show | jobs
by rohitarondekar 4161 days ago
For the second return to work doesn't the if have to be an expression i.e return the result of evaluating either y or z as the result of the if expression? If the language has if statements like say Javascript then it won't work.
1 comments

Yes. And that is why statement–expression distinctions are stupid, because they obscure these relationships. In C-land it would be “if-else” vs. “?:”.