Q: Passing seq-exprs to for using quoting I'm trying to pass seq-exprs to for using quoting, but both of my attempts below result in CompilerException java.lang.IllegalArgumentException: for requires a vector for its binding. I am clearly misunderstanding something about how quoting and evaluation (and related concepts) work.
(let [v ['b (range 2)]]
   (for v b))

(let [v '[b (range 2)]]
   (for v b))

What is the correct way to do it and how would you explain to begineer why none of the implementations above work? Thanks!
edit:
I know I can do 
(let []
   (for [b (range 2)] b))

What I'm trying to achieve is to be able to pass a vector of bindings (e.g. output of another function)
edit 2, motivation/background:
I am building a transpiler [repo] and I'm trying to translate and unroll a for loop (including nested loops, example), so I thought that I could append ranges of variables to be iterated over to seq-exprs while traversing the AST (Abstract Syntax Tree) deeper through nested loops, and then evaluate the translated relationships (relationships can always be translated one by one) contained within each of the original for blocks given the 'bindings' generated by clojure for. Do you have advice if there is a 'better' way to do it?

A: This is exactly the distinction between macros and functions. Functions take and return data at runtime. Macros, however, take and return code at compile-time.
Consider the following:
(defn foo [arg]
  (str arg))

(let [x (dec 10)]
  (foo x)) ;=> "9"

foo sees the integer 9 as the argument, because the current runtime value of x is 9. However, foo can't know that the value 9 was represented by the symbol x, because the symbol x is code.
(defmacro bar [arg]
  (str arg))

(let [x 9]
  (bar x)) ;=> "x"

(str 'x) => "x"

So if we change it to a macro, we get the compile time value of x, which is just the symbol x.
(We change it to a string, then it's returned as code, and the string "x" as code just evaluates to "x".)
The important takeaway here is that in the same way foo can't know that it was passed something called x, it just knows that the runtime value is 9 , bar only knows it was passed something called x, it has no way of knowing what the runtime value of x is.
This is why macros are contagious.
So in your example, the runtime value of v is '[b (range 2)], but the compile-time value that you pass to for is just the symbol v itself.
To solve your immediate problem, you could do something like this:
(let [v '[b (range 2)]]
  (eval `(for ~v ~'b)))

But that is just... horrible. What you probably want is to write a macro.
I'm not sure what this macro would look like, because I'd have to understand the actual problem that you want to solve, but here's an example of a macro that takes seq-exprs and passes them on to for.
;; Minimal example of a macro that takes seq-exprs as code
;; and returns code with a for that uses them.
(defmacro forv [seq-exprs body]
  `(vec (for ~seq-exprs ~body)))


A: ['b (range 2)] => ['b (0 1)] with this example you have a symbol called b and also you are calling the function (range 2) which evals (0 1)
'[b (range 2)] => [b (range)] in this example you are quoting all expression so you end up having symbol b and range symbol within a list data structure.
About your for loop, you are getting that exception because you are not using it properly(missing vector binding).
This is how you should write a for loop:
(for [i (range 5)] ;;you need to define vector in here
     (do 
         (println "I: " i) 
         i));;let's return i here

Result:
I: 0
I: 1
I: 2
I: 3
I: 4
=> (0 1 2 3 4)

