On Mon, Jan 26, 2009 at 8:19 PM, James Reeves
<weavejes...@googlemail.com> wrote:
>
> On Jan 27, 2:08 am, Mark Volkmann <r.mark.volkm...@gmail.com> wrote:
>> Let's see if I've got this straight.
>>
>> (def foo 1) creates a Var in the default namespace with a value of 1.
>>
>> (create-ns 'com.ociweb.demo) ; creates a new namespace
>> (intern 'com.ociweb.demo foo 2) ; creates another Var named foo, but
>> it's not in the default namespace
>>
>> But the last line gives a java.lang.ClassCastException. What's wrong
>> with that line?
>
> Because it should be: (intern 'com.ociweb.demo 'foo 2)
>
> Gotta quote that symbol :)

Thanks!

What's the rationale for treating "foo" differently than in a def? I'm
referring to the need to quote foo in an intern, but not in a def. Is
it just because def is a special form whereas intern is a function?

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~---------~--~----~------------~-------~--~----~
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
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