Why the following code cann’t pass compilation?
(defn testit [asym] (var asym))
The error is:
CompilerException java.lang.RuntimeException: Unable to resolve var: asym in this context, compiling:(NO_SOURCE_PATH:1)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
asymthere is not avar, it’s a local; in this case, the sole argument to the function that you’re defining as the value of thetestitvar.If you want to return
asymfrom that function:If
asymis a symbol that names a var you want to return, then useresolve:General note:
(var x)is the expanded special form corresponding to the reader syntax#'x.