This is more of a suggestion, not really sure where to post it though. Please refer me to the relevant forum if there exists a better one.
Basically I'm going under the assumption that no one uses let
without a body. The only reason I can imagine for doing that is purely for side-effects, and do
etc. are a much better fit, and currently (let [x 1 y 2 z (+ x y)]) => nil
(rather than throwing a spec error, as if this is useful expected behavior? But why?)
In any case, if my assumption is correct, then I propose let
returns the last assigned value, such that (let [x 1 y 2 z (+ x y)]) => 3
, that is z
. This is ergonomic, and intuitive in my eyes. It's also especially useful for long binding forms building off of the same variables only for the final one to be important, which then requires a whole row with special funky indentation just for that.