Skip to content

Instantly share code, notes, and snippets.

@ddillinger
Created April 11, 2012 13:52
Show Gist options
  • Save ddillinger/2359425 to your computer and use it in GitHub Desktop.
Save ddillinger/2359425 to your computer and use it in GitHub Desktop.
Clojure wat
user=> (def bs '[a 1 b 2])
#'user/bs
user=> (type bs)
clojure.lang.PersistentVector
user=> (vector? bs)
true
user=> (let bs (+ a b))
java.lang.IllegalArgumentException: let requires a vector for its binding (NO_SOURCE_FILE:0)
@ddillinger
Copy link
Author

Yeah, and for someone "in the know" it is trivial to demonstrate what happened:

user=> (defmacro foo [thingy] (type thingy))
#'user/foo
user=> (foo bs)
clojure.lang.Symbol

But this sort of thing can be so bewildering to fresh clojure programmers, and the error is effectively telling you to do exactly what you did, as far as a naive inspection might discover.

It makes me feel bad for the newbies :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment