Details
-
Type:
Defect
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: Release 1.2, Release 1.3, Release 1.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:all
-
Patch:Code
Description
The form:
(ns foo (:print "I AM A ROBOT"))
will print "I AM A ROBOT"
This is because the defmacro takes the name of the first element of the reference, looks it up in the clojure.core namespace and invokes it on the rest of the args.
This is minor, but it does mean that an otherwise declarative form is not executing code.
Alan: please note that :refer was not mentioned in the docstring for ns, or used in any of the unit tests for clojure.
Are you sure that it is an expected argument, or just an arrangement that happens to work under the current ns macro? The docstring for 'refer itself says to use :use in ns macros instead of calling refer.
I added "refer" to the set of accepted references all the same.