Let's say that little surprises are not a design objective. :-) Please do follow up with additional questions as you have them.
Stu > Hi Stu. > > Thanks. That makes sense. > > Is this special-casing documented somewhere, or is it something one can only > discover by playing? More generally, I'm wondering whether I'm likely to > come across other areas with little surprises as I learn more. An example: > I've been exploring special symbols, and it seems to me that the > documentation doesn't quite match behaviour, or at least the documentation > doesn't say all that it might say -- I might post about that separately. > > Simon > > > On Thu, Apr 21, 2011 at 18:23, Stuart Halloway <stuart.hallo...@gmail.com> > wrote: > Hi Simon, > > in-ns and ns are special cased for convenience. Usually in-ns is used to > enter a namespace that has already been loaded, so that core names are > available. For example: > > ;; in a file > (ns my.ns) > > ;; stuff > > (comment > (require 'my.ns) > (in-ns 'my.ns) > > ;; tests > ) > > > Stu > >> Hi. >> >> I'm learning Clojure, currently using Clojure 1.2. >> >> http://clojure.org/namespaces when talking about creating >> namespaces says: >> At the Repl it's best to use in-ns, in which case the new >> namespace will contain mappings only for the classnames >> in java.lang. In order to access the names from the >> clojure.core namespace you must execute >> (clojure.core/refer 'clojure.core). >> >> Given the above, in the following... >> _________________________________________ >> | >> | user> (in-ns 'my-new-ns) >> | #<Namespace my-new-ns> >> | >> | my-new-ns> (in-ns 'user) >> | #<Namespace user> >> |_________________________________________ >> >> ...how does the second in-ns get resolved? >> For comparison, use of most other operators from my-new-ns gives >> resolution errors. For example: >> _________________________________________ >> | >> | my-new-ns> (+ 1 2) >> | ;; Evaluation aborted. Unable to resolve symbol: + in this context >> |_________________________________________ >> >> -- >> 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 >> Note that posts from new members are moderated - please be patient with your >> first post. >> 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 > > Stuart Halloway > Clojure/core > http://clojure.com > > > -- > 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 > Note that posts from new members are moderated - please be patient with your > first post. > 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 > > > -- > 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 > Note that posts from new members are moderated - please be patient with your > first post. > 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 Stuart Halloway Clojure/core http://clojure.com -- 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 Note that posts from new members are moderated - please be patient with your first post. 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