2009/7/10 Michael Wood <[email protected]>:
> 2009/7/10 Rowdy Rednose <[email protected]>:
>>
>> Actually, it didn't work (apart from having a "not" in there, which I
>> only used for testing).
>>
>> Calling sync directly works, though:
>>
>> (ns clojure.core)
>> (defmacro dosync [& body]
>>  `(do
>>     (assert (javax.swing.SwingUtilities/isEventDispatchThread))
>>     (sync nil ~...@body)))
>>
>> But can't I somehow refer to the original dosync from my new dosync
>> macro?
>
> Try referring to it as clojure.core/dosync.

Sorry, I just realised you were in the clojure.core ns already.  Once
you've redefined dosync the original is gone (as far as I understand
it.)  Maybe you could first:

(def old-dosync dosync)

before redefining it, but I think it's probably better to create a new
docync in your own namespace and then refer to the original as
clojure.core/dosync.

i.e. something like:

(ns foo.bar (:refer-clojure :exclude [dosync]))

(defmacro dosync [...]
  ...
  (clojure.core/dosync ...))

-- 
Michael Wood <[email protected]>

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

Reply via email to