2

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

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

1 Comment

You could write the expression as ((comp :name meta) #'+) or (-> + var meta :name).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.