Jiacai Liu
Jiacai Liu

Reputation: 2743

CompilerException java.lang.RuntimeException: Unable to resolve symbol: var in this context

I use following code to get function name as symbol type

(:name (meta (var +)))

However, when I change to this,

((comp :name meta var) +)

CompilerException is thrown

Upvotes: 2

Views: 664

Answers (1)

OlegTheCat
OlegTheCat

Reputation: 4513

var is one of Clojure's special forms. Special forms define a way in which its subexpressions are treated; they may define special syntax and evaluation rules for those subexpressions. Special forms (and var operator in particular) are not functions and, in general, cannot be used in the manner functions are used.

Upvotes: 5

Related Questions