On Tue, Nov 17, 2009 at 4:22 PM, Chouser <[email protected]> wrote:

> On Tue, Nov 17, 2009 at 4:11 PM, John Harrop <[email protected]> wrote:
> > On Tue, Nov 17, 2009 at 3:59 PM, nchubrich <[email protected]>
> > 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.


I didn't say there were ONLY two ways. In fact I expected there'd be at
least some ways involving calling Java APIs on some Clojure objects such as
namespaces, though mucking about in the guts like that is even more perilous
(and, particularly, prone to break when Clojure changes its internals).

How stable is the intern function likely to be?

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

Reply via email to