On Mar 14, 12:44 pm, Rock <rocco.ro...@gmail.com> wrote: > Hi all. I've been working on a piece of code (an xml-rpc server) in > Python (actually Jython), and one of its features is the capability of > loading modules (connectors in Java) during runtime. Not only are > these modules dynamically loaded on request (their names passed as > arguments in a string), but they are only visible in the lexical scope > of the specific method/function, the resources being released as soon > as that same scope is left. > > Now, I would love to recode this stuff in Lisp, especially Clojure. > But is it possible to pull this off? From what I've been reading, it > actually doesn't seem like it.
Loading namespaces and classes can be done fully dynamic at runtime (and this is actually the default behavior when you're not using the AOT-compilation capabilities of Clojure; regular late binding). To release the resources (classes loaded on demand), you'd have to use a dedicated classloader, since the JVM only unloads loaded classes when their classloader is GCd. As for lexically scoping loaded classes, is this a security issue or do you just want to avoid polluting the global namespace? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---