|
|
|
|
|
by frankpf
2224 days ago
|
|
I don't use lisp languages, but one basic difference this has from other lisps is that functions accept multiple expressions, e.g.: (defn greet [firstname lastname]
(def fullname (string firstname " " lastname))
(string "Hello, " fullname))
In other lisps, you'd have the last expression nested inside a `let` block: (defn greet [firstname lastname]
(let [fullname (string firstname " " lastname)]
(string "Hello, " fullname)))
which makes the code hard to read and edit IMO. Languages like Haskell and OCaml suffer from a similar problem too. |
|
That's interesting, I've always really loved the "return last expression in a block" syntax. (Ruby and Rust can be added to your list as well.) That syntax just reads really naturally to me.