That's actually a really clever (yet simple) design. Have other languages done this before?
Now I cannot "unsee" that concept. Why isn't if/else an expression in other languages that just yields a value?! That's a powerful idea.
Now I cannot "unsee" that concept. Why isn't if/else an expression in other languages that just yields a value?! That's a powerful idea.
Well, yeah, Scala obviously, the primary language from which Kotlin drew inspiration for its syntax and features.
LISP. For a more recent example, Rust.
That’s one thing I like about Rust: it fuses functional and imperative styles very naturally.
[0] “ML” here meaning the family of languages including SML and OCaml, which inspired (to varying degrees) Haskell, Rust, some parts of modern C++, and surely others. Not “machine learning”.