You can expose ScriptableObjects that you have called defineProperty[1] on in order to create their interface, no?
If I'm not mistaken, creating a method is like defining a property with the value that is a proxy of Function. [1]: http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/ScriptableObject.html#defineProperty(java.lang.String, java.lang.Object, int) On Wed, Mar 18, 2009 at 6:56 AM, Sverre Johansen <sverre.johan...@gmail.com> wrote: > > Hi, > > I'm working on a tool where I am embedding the Rhino JavaScript engine > within Clojure and exposing an API to JavaScript. Rhino has support for > exposing Java objects directly. > > I want to define this Java API in Clojure, but as I've understood it there is > no > way in Clojure to create this at runtime. I could use proxy, but then it's > only > possible to implement already existing interfaces. > > The alternative is gen-class, but then I need to first compile and add > the classes to my class path, and for me that doesn't match well with > the way I like to develop using Emacs and Slime. I want to implement > one method at the time and "play around" without having to restart the > JVM between each change. > > Is there anything I'm missing, or will there be a way in the future to create > dynamic Java objects at runtime? > > -- > Sverre Johansen > > > > -- Venlig hilsen / Kind regards, Christian Vest Hansen. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---