An example of update-proxy in case it may help anyone in the future:
user> (import java.util.Date)
java.util.Date
user> (def d (proxy [Date] [] (toString [] "hello")))
#'user/d
user> d
#<Date$0 hello>
user> (.toString d)
"hello"
user> (.toGMTString d)
"17 Nov 2010 12:57:28 GMT"
user> (update-proxy d {"toGMTString" (fn [this] "goodbye")})
nil
user> (.toGMTString d)
"goodbye"
On Wed, Nov 17, 2010 at 7:48 AM, Mark Rathwell <[email protected]>wrote:
>
> Beautiful. Thank you!
>
>
> On Wed, Nov 17, 2010 at 2:07 AM, Liam <[email protected]> wrote:
>
>> More information from Rich himself about "update-proxy" when he first
>> introduced it. Could not find examples for you except from the Joy of
>> Clojure book on page 273, but it is very trivial... just like the doc
>> string sounds.
>>
>>
>> http://groups.google.com/group/clojure/browse_thread/thread/ed1652132dfa623c/a78eac7875bd2866?#a78eac7875bd2866
>>
>> --
>> 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]<clojure%[email protected]>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>>
>
>
--
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