On Sun, Dec 21, 2008 at 3:44 PM, Stephen C. Gilardi <squee...@mac.com> wrote:
>
> On Dec 21, 2008, at 4:35 PM, Mark Volkmann wrote:
>
> Why do I get an IncompatibleClassChangeError below?  I'm using revision
> 1180.
>
> (def my-map {:a 1 :b 2})
> (namespace my-map)
> java.lang.IncompatibleClassChangeError (NO_SOURCE_FILE:0)
>
> I got a more informative message, with the difference perhaps being running
> Java 6 instead of Java 5:
> user=> (namespace my-map)
> java.lang.IncompatibleClassChangeError: Class
> clojure.lang.PersistentArrayMap does not implement the requested interface
> clojure.lang.Named (repl-1:3)
> In the call to (namespace my-map), my-map is a symbol and the rule for
> evaluating symbols (as function arguments and elsewhere) is that they are
> replaced by the value of the var they name.
> Your call got evaluated as (namespace {:a 1 :b 2}) which doesn't work.
> What were you intending to determine in your call?
> --Steve

I thought that every symbol and keyword was in some namespace,
defaulting to the current namespace when the symbol or keyword is
defined. Since the default namespace in the REPL is user, that's what
I expected. I get the same error though with any symbol that I def.
For example,

(def n 1)
(namespace n)
java.lang.IncompatibleClassChangeError (NO_SOURCE_FILE:0)

Shouldn't the namespace of n be user?

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