On Tue, Jan 27, 2009 at 10:05 AM, Brian Doyle <brianpdo...@gmail.com> wrote:
>
> On Tue, Jan 27, 2009 at 7:43 AM, Chouser <chou...@gmail.com> wrote:
>>
>> user=> (def expr (read (java.io.PushbackReader. (java.io.StringReader.
>> "(+ 1 2)"))))
>> user=> (first expr)
>> +
>> user=> (namespace (first expr))
>> nil
>
> This nil namespace seems a bit odd.  Wasn't expr created in the user
> namespace?

But vars get their namespace from where they're defined, not where
they're used.  I'm not defining anything in that example, I'm just
providing a list of values -- one symbol and two numbers.

The nil namespace on the symbol means I'd like Clojure
to use it's resolution rules to go find the correct Var, possibly as
referred from another namespace.

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