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.
Attachments
Activity
Craig Brozefsky
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | ns-patch.diff [ 11395 ] |
Craig Brozefsky
made changes -
| Attachment | ns-patch.diff [ 11412 ] |
One apparent problem with this patch is that you throw an exception for :refer. You should add that, and make sure there aren't any others missing. Also, #{x y z} is better than (set [x y z]), and you should probably use pr-str rather than str, although I can't think of a case where it matters for the objects in question.