I find this behaviour a little surprising:
--foo/core.clj:
(ns foo.core
(:require [foo.bar :as test]))
(def ark (test/a-var test/another-var))
--foo/bar.clj:
(ns foo.bar)
(def a-var {:animal "dog"})
(def another-var {animal: "cat"})
REPL:
in the repl I get:
foo.core> (map class ark)
=>
(clojure.lang.Symbol clojure.lang.Symbol)
and (consequently)
foo.core> (:animal (first ark))
=>
(nil)
but
foo.core> (class test/a-var)
=>
clojure.lang.PersistenStructMap
and I can use :animal to get "dog".
I guess it's java classpermissions biting, but I'd love to know why it
happens. To me it's like clojure doesn't look up a symbol that resides in
another namespace, but that explanation is quite weak.
/Linus
--
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