There's about 3-4 CLJ tickets related to this. The issue is that  :dynamic
is only read once: when the var is created. If you need to change a var to
be dynamic, you can set it manually with .setDynamic.

Personally I think it's simply an artifact of how defs are created, and
it's never been enough of a pain to anyone to suggest a better solution.

What's being asked for is some sort of trigger. When :dynamic is set in the
metadata call setDynamic. This seems like a bad idea to me.

Timothy Baldrige


On Thu, Jan 3, 2013 at 10:44 AM, Brian Marick <mar...@exampler.com> wrote:

> Why does this:
>
>         (def ^{:dynamic true} bar 33)
>
> … work to create a dynamic var, but this:
>
>         (intern *ns* (with-meta 'foo {:dynamic true}) 33)
>
> … doesn't? (Looking more for the justification than mechanics.)
>
> --------
> Occasional consulting on programming technique
> Contract programming in Ruby and Clojure
> Latest book: /Functional Programming for the Object-Oriented Programmer/
> https://leanpub.com/fp-oo
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to