On Dec 22, 11:57 am, Chouser <chou...@gmail.com> wrote:
> On Mon, Dec 22, 2008 at 11:31 AM, Stuart Sierra
>
> <the.stuart.sie...@gmail.com> wrote:
>
> > On Dec 22, 11:05 am, Rich Hickey <richhic...@gmail.com> wrote:
> >> But I think there is a tendency to bring presumptions from CL's
> >> symbols/packages/interning, many of which do not apply.
>
> > Sounds like a good FAQ, or another entry inhttp://clojure.org/lisps
>
> > If I may: "Unlike Common Lisp, symbols and keywords are just
> > identifiers.  They are never 'interned' and they do not store values.
> > Values are stored in Vars.  Every Var has a name, which is a symbol,
> > and a namespace.  Vars are created with 'def' forms.
>
> Except keywords *are* interned (unlike symbols), though this doesn't
> mean any storage location is interned.
>
> (identical? :foo :foo) ==> true
> (identical? 'foo 'foo) ==> false
>

Well, intern is also an overloaded term. They are interned like Java
Strings are interned - any two keywords with the same :ns/name are the
same object. But not in the sense of Clojure/CL's intern function.

> Also, not every Var has a name, just ones that are interned in a
> namespace:
>
> user=> (def x)
> #'user/x
> user=> (.sym (intern 'user 'x))
> x
> user=> (with-local-vars [y 99] (.sym y))
> nil
>
> And Vars can be created with the various forms of 'def', but also with
> 'intern' and 'with-local-vars':
>
> user=> (.sym (intern 'user 'x))
> x
>

Here the use of "intern" is more like CL's. Vars are interned in a
namespace (CL package) through which they can be found.

Rich

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