In a let
form (Clojure here) I can doing something like
(let [[u s v] (svd A)]
(do-something-with u v))
where svd
def
is a special form at the compiler level: it makes a Var. def
has to be available and usable before destructuring is available. You see something similar with let*
, a compiler primitive that supports no destructuring: then after several thousand lines in clojure/core.clj
the language is finally powerful enough to provide a version of let
with destructuring, as a macro on top of let*
.
If you want, you can write a macro (say, def+
) that does this for you. Personally I think it's kinda gross and wouldn't use it, but using a Lisp means getting to use a language that suits you personally.