Re: Create dynamic vars programmatically

77 views
Skip to first unread message

Herwig Hochleitner

unread,
Sep 4, 2012, 8:07:27 PM9/4/12
to clo...@googlegroups.com
2012/9/4 mdzaebel <mdza...@web.de>
(doseq [s '(a b c)] (intern *ns* s 0)) creates non-dynamic var's.

However, how could I produce dynamic var's. I tried with-meta but failed. In other words, what does (def ^:dynamic a) internally do?


kind regards

Herwig Hochleitner

unread,
Sep 4, 2012, 8:13:57 PM9/4/12
to clo...@googlegroups.com
Beware however, that interning vars programmatically is not recommended. If you need fresh vars during runtime, use with-local-vars, which also produces dynamic vars.

Marc Dzaebel

unread,
Sep 7, 2012, 5:28:03 PM9/7/12
to clo...@googlegroups.com
Sorry for delay, I had difficulties with Google Groups ... posted several times.

Thanks about the hint about with-local-vars, Marc
Reply all
Reply to author
Forward
0 new messages