Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
rohitarondekar
· 11y ago · 0 comments
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.
Comments
[–]
evincarofautumn
11y ago
Yes. And that is why statement–expression distinctions are stupid, because they obscure these relationships. In C-land it would be “if-else” vs. “?:”.