Y
Hacker News
new
|
ask
|
show
|
jobs
by
jeremiep
4915 days ago
The ternary is an expression, not a statement :)
You can write: a = b ? c : d; in C/C++, you can't write a = if(b) { c; } else { d; }.
1 comments
tarabukka
4914 days ago
Oh, yeah. My mistake. Although what you describe is a lot more functional in style. You could probably emulate it in a language with higher-order functions.
link