Hello,

I had some difficulty writing the following java code in Clojure:

    Runnable runnable = new Runnable() {
      public void run() {
        animate();
        display.timerExec(TIMER_INTERVAL, this);
      }
    };
    display.timerExec(TIMER_INTERVAL, runnable);


For the moment I have worked around the 'this' reference using refs.
Is there a cleaner way of doing this? If not a 'this' function/symbol
might be useful for the proxy macro.

This is roughly how I wrote it:

(let [runnable (ref nil)]  (dosync (ref-set runnable (proxy [Runnable]
[] (run [] (animate) (dosync ... @runnable ...

--~--~---------~--~----~------------~-------~--~----~
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
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