On Tue, Nov 17, 2009 at 4:11 PM, John Harrop <jharrop...@gmail.com> wrote:
> On Tue, Nov 17, 2009 at 3:59 PM, nchubrich <nicholas.chubr...@gmail.com>
> wrote:
>>
>> How do you def a symbol that you make using (symbol)?  I.E. if I try
>> to do (def (symbol "x") 2) I get:
>> java.lang.Exception: Second argument to def must be a Symbol.  (And
>> why does it say the \second argument must be a symbol?)
>
> Special forms and macros don't evaluate their arguments. So def's second
> argument here is a list of the symbol "symbol" and the string literal "x".
>
> There are two ways to do what you want: macros and eval.

You might also want to look at the 'intern' function.

--Chouser

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to