Why LET doesn't work with VECTOR?

clojure

Solution

The let special form binding form is required to be a vector literal not just an expression that would evaluate to a vector.

Why? Roughly stated, the expression must be compiled before it can be evaluated. At compile-time `(vector x 1)` will not have been evaluated to a `vector`, it will just be a list. Indeed if it were to be evaluated, the arguments of `vector` would be evaluated, meaning `x` would have to be resolved. But, you don't want `x` to be resolved, you want it bound.

Problem

Instead of ``` (let [x 1] (my-expression)) ``` I'm trying to use: ``` (let (vector x 1) (my-expression)) ``` Don't ask why, I just like normal brackets more. But Clojure says: ``` let requires a vector for its binding in ... ``` What's wrong?

Original source