↳
In-reply-to
»
@prologic Which one? I don't mind the ternary operator at all. In fact, I often find myself missing it in Go. I don't find the two alternatives particularly elegant:
⤋ Read More
@prologic@twtxt.net Yes, C has it. I even thought that C invented it, but it seems to stem from CPL.
The closest to get to if expressions at the moment is to use a lambda:
foo := func() {
if bar {
return "spam"
}
return "eggs"
}()
But that’s also not elegant at all.