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 in http://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 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 Adding all those details to your nice simple prose just makes a mess of things, but if I may start with your basic structure... "Unlike Common Lisp, Symbols and Keywords are just identifiers, and don't store values. Instead, use Vars for global value storage. Vars are normally created with 'def', which gives the Var a name (which is a Symbol) and interns it in a namespace." > "A namespace is a collection of Vars. Every namespace has a name, > which is a symbol. A namespace also has collections of other things -- imported class names, aliases, etc. > "Symbols and keywords have two parts: a namespace part, which may be > nil or a string; and a name part, which is a string." I tried very very hard, but couldn't find anything to complain about for this one. :-) Thanks for taking the initiative, Stuart. --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 -~----------~----~----~----~------~----~------~--~---