Error formatting macro: pagetree: java.lang.NullPointerException
Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

Motivation

Clojure (1.3.0/2.0) has included new features around marking vars dynamic. This is done via metadata on the var. If a dynamic var is detected and no metadata is provided on the var, it will print a warning message when the namespace is loaded that looks like the following:

While these warnings are trivial to fix when declaring a var with def it isn't currently possible to mark a var dynamic if it is declared via declare.

Obstacles

  • Simply adding metadata on declare would introduce a situation where at the time of actual declaration the re-def would overwrite the metadata. Currently there is no way to examine the metadata that exists when re-deffing a var brought in via declare

Use Cases

  • declare
  • functions that take primitives
Labels: