Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
rohitarondekar
on Jan 20, 2015
|
parent
|
context
|
favorite
| on:
Striking parallels between mathematics and softwar...
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.
evincarofautumn
on Jan 20, 2015
[–]
Yes. And that is why statement–expression distinctions are stupid, because they obscure these relationships. In C-land it would be “if-else” vs. “?:”.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: