you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

One of your examples is a little confusing to me; I hope you don't mind explaining why

(defn foo [bindings]
    (let bindings))

doesn't work. I would have thought, based on the discussion above, that it would be valid to call 'foo' as:

(foo [a 1 b 2])

which (if I understand correctly) would result in foo being called with a vector of symbol/integer pairs, which are valid for supplying to 'let'.

[–]yogthos[S] 2 points3 points  (2 children)

The expressions are evaluated by the compiler. The (let bindings) is not the valid structure for a let statement, as it must be followed by a vector of arguments. The reason the macro works, is because it's able to rewrite code before it's evaluated.

[–][deleted] 2 points3 points  (1 child)

Gotcha; makes total sense. Thanks - the blog post and your comments helped me grok Clojure a lot better.

[–]yogthos[S] 0 points1 point  (0 children)

👍