Return value of `begin ... end`

Julia, like Lisp (and most functional programming languages), is an expression-oriented language and doesn’t have statements. You’ll note that in Python, assignment is a statement. But then they eventually felt compelled to add the := operator just so that you can do an assignment that is an expression. Of course, why have assignment be a statement in the first place? So that you can’t accidentally do if x = 123 and have it evaluate to true. But Julia doesn’t have truthiness, which is a fundamentally broken concept, so this isn’t a big issue in the first place.

10 Likes