On Dec 22, 2008, at 1:42 PM, Brian Doyle wrote:
It happens to work as things are currently implemented. This has come up before and Rich's advice is that we should use the documented forms, introduced by keywords, exclusively.It would appear that using (:import ...) and (import ...) with the ns function work the same (svn rev 1172.) 1:1 user=> (ns blah (import (java.net URL))) nil 1:2 blah=> (URL. "http://www.clojure.org") #<URL http://www.clojure.org> and 1:1 user=> (ns blah2 (:import (java.net URL))) nil 1:2 blah2=> (URL. "http://www.clojure.org") #<URL http://www.clojure.org> Is this true and if so does it work for all of the other types of references as well?
This is one of those cases where it's valuable for there to be one way to do it: there may come a time (perhaps it's already true) when other tools besides Clojure's reader/compiler will be reading the "ns" form in a file to gather information about the namespace/lib and its dependencies. Such tools should only be expected to work with the canonical, documented form which introduces :import, :use, and :require clauses with keywords.
Please use only keywords to introduce these clauses. --Steve
smime.p7s
Description: S/MIME cryptographic signature