Re:Statements vs. Expressions
by amadeuspagel on Thursday July 14, 2022 @07:14AM
(#32094429)
For example, you might have tried writing something like this:
Doesn't work because statements don't yield values.
[ Parent
| on HN ]
Thats one of the reason why I REALLY like languages where everything is an expression.
let foo =
if x < y
somevalue
else
someothervalue
in f# for example.I also love F#. One of the most interesting languages that I've ever seen.
This is certainly another great aspect of it.
So are ternaries expressions then too?
const x = x < y ? 2 : 3;
Re:Statements vs. Expressions
by amadeuspagel on Friday July 15, 2022 @06:03AM
(#32106504)
Yes, indeed.