contrib macro-utils broken by :dynamic

34 views
Skip to first unread message

Stuart Sierra

unread,
Oct 19, 2010, 7:02:27 PM10/19/10
to Clojure Dev
After Clojure commit d1006391595641f16e9c54187a8df0a0138d3a53

Not surprising, all things considered.

Test results:
http://build.clojure.org/job/clojure-contrib/237/org.clojure.contrib$macro-utils/console

-S

Konrad Hinsen

unread,
Oct 20, 2010, 4:07:27 AM10/20/10
to cloju...@googlegroups.com
On 20 Oct 2010, at 01:02, Stuart Sierra wrote:

> After Clojure commit d1006391595641f16e9c54187a8df0a0138d3a53
>
> Not surprising, all things considered.

Is there a description somewhere of this apparently new stable/dynamic
var system? The commit message is not quite enough for me.

Konrad.

Rich Hickey

unread,
Oct 20, 2010, 9:42:54 AM10/20/10
to cloju...@googlegroups.com
You must now declare vars ^:dynamic if you intend to rebind them.
Search for uses of ^:dynamic and setDynamicin the core sources for
examples.

The relevant commit message is here:

http://github.com/clojure/clojure/commit/b9b1a094499b69a94bd47fc94c4f082d80239fa9

Rich

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure Dev" group.
> To post to this group, send email to cloju...@googlegroups.com.
> To unsubscribe from this group, send email to clojure-dev...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/clojure-dev?hl=en
> .
>

B Smith-Mannschott

unread,
Oct 20, 2010, 9:54:31 AM10/20/10
to cloju...@googlegroups.com
On Wed, Oct 20, 2010 at 15:42, Rich Hickey <richh...@gmail.com> wrote:
> You must now declare vars ^:dynamic if you intend to rebind them. Search for
> uses of ^:dynamic  and setDynamicin the core sources for examples.
>
> The relevant commit message is here:
>
> http://github.com/clojure/clojure/commit/b9b1a094499b69a94bd47fc94c4f082d80239fa9

I've read clojure unit tests which temporarily bind functions called
by the function under test using binding. (Analagous to mocking in
when testing OO code.) This seems to be a handy idiom.

Am I correct in understanding that this change will now require
functions called by the function under test to be declared ^:dynamic
in order for test code to rebind them?

// Ben

Konrad Hinsen

unread,
Oct 22, 2010, 4:37:37 AM10/22/10
to cloju...@googlegroups.com
On 20.10.2010, at 15:42, Rich Hickey wrote:

> You must now declare vars ^:dynamic if you intend to rebind them. Search for uses of ^:dynamic and setDynamicin the core sources for examples.
>
> The relevant commit message is here:
>
> http://github.com/clojure/clojure/commit/b9b1a094499b69a94bd47fc94c4f082d80239fa9

Thanks, that looks simple enough!

Konrad.

Reply all
Reply to author
Forward
0 new messages