[CLJ-951] Clojure 1.3+ can't intern a dynamic var Created: 09/Mar/12 Updated: 30/Nov/12 Resolved: 30/Nov/12 |
|
| Status: | Closed |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | Release 1.3, Release 1.4 |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Ryan Senior | Assignee: | Unassigned |
| Resolution: | Declined | Votes: | 0 |
| Labels: | None | ||
| Approval: | Not Approved |
| Description |
|
In Clojure 1.3+, interned vars don't set the dynamic field in clojure.lang.Var and can't be used in a binding: user=> (intern ns (with-meta 'dyna-var {:dynamic true}) 100) The var has the right metadata user=> (meta #'dyna-var) But doesn't set the dynamic flag on the var: user=> (.isDynamic #'dyna-var) The push-thread-bindings function looks for the .dynamic flag. Vars created via def have it: user=> (def ^:dynamic def-dyna-var 100) Along with the metadata user=> (meta #'def-dyna-var) |
| Comments |
| Comment by Timothy Baldridge [ 30/Nov/12 3:57 PM ] |
|
This is actually an enhancement. The Var.java and Namespace.java code does not attempt to read the metadata on the var. Instead, the compiler handles this at compile time. If you would like to see this behavior changed, feel free to bring it up on clojure-dev, and we'll discuss it. Closing until that time. |