On Sun, Jan 4, 2009 at 1:28 AM, Tom Faulhaber <tomfaulha...@gmail.com> wrote: > > 1) This use case may be obscure enough that I should just buckle down > and give (ns (:gen-class ...)) some love.
It may be, but let me again mention the option of gen-interface plus proxy. Sometimes you need to produce a physical .class files of concrete types (for servlet containers, for use with android, etc.). But if that's not the case, you may prefer the simplicity of gen-interface. Then you can implement your interface in as many ways as needed using 'proxy'. > 2) It occurred to me after writing my previous message, that it would > be pretty trivial to write a (proxy+ ...) extension outside the core. > If it found enough use, it could be pulled in (a la condp) as a non- > breaking change sometime in the future, Excellent point. gen-interface itself started in contrib. > In another direction, your response gave me kind of a sick idea. It > would be pretty easy (I think) to create a "proxy-map" function: > > (proxy-map [amap akey] ...) > > proxy-map would create a new object that wrapped the map it was passed > and implemented IPersistantMap. It would also examine the the object > (presumably some Java object) at (akey amap) and proxy all the methods > it implements to it. Yeah, that is kind of sick. :-D --Chouser --~--~---------~--~----~------------~-------~--~----~ 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 clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---