by User23 · 4y ago · 0 comments
Go core are very smart people so I’m sure they have their reasons, but my Lisp-addled brain can’t understand why you’d ever want statements instead of expressions with potentially discarded values.
v := if foo() {
7
} else {
11
}
But this means {} blocks now have values, which is weird in a C derivative. Of course, one could do v := func() int {
if foo() {
return 7
} else {
return 11
}
}()
but... that's kind of awful.