> One more question: is there a way to call a function similar to > reloadClasses in Clojure? If so, it would be my solution.
Yep, I work with a multi-tab console with a rlwrap repl window and another window for builds (ant) and other general stuff, then I use the clojure load function to reload any classes and/or clj sources that have changed, for example; from the repl... (use 'twlib.jty)(start-jty 8080) which loads and starts my jetty instance. The twlib.jty module (clj) uses (ns :use/:import etc, to load all the dependencies. Then during the session, I might say change twlib/xxx.clj, and I then just use (load "twlib/xxx") to reload the new version. It's not totally reloadable as you have to restart if you add new functions or other structural changes. With rlwrap I have the up-arrow/down-arrows set to incremental command history recall, so you can just type one or 2 characters of a previous repl line, hit the up arrow to recall and press Enter to execute. Tabbing between console tabs and with a good recall setup, it's little more than a couple of key strokes to almost instantaneously do a build, reload or restart. And of course you have full interactivity with the executing environmnent (jetty and other java libs, etc) directly through the repl. I also typically have one or more other console tabs open with ssh sessions to (linux) servers where I have similar setups. It sounds messy but it's the most efficient jvm platform dev environment I've worked with. I have the identical setup on my mac laptop and linux servers. I'm not sure how the equivalent would work on Windows though. Rgds, Adrian. On Tue, Mar 10, 2009 at 2:40 PM, Javier <javu...@gmail.com> wrote: > > Thank you for your response. I'm actually using BeanShell for doing > most of this stuff, as it provides reloadClasses(), wich allows a very > fast reloading of every change (anyway, changes in code which is > actually in use are not propagated, but this is an expected issue). > I'll have a glance to the link you provide. > > One more question: is there a way to call a function similar to > reloadClasses in Clojure? If so, it would be my solution. > > > > > On 10 mar, 11:44, Chas Emerick <cemer...@snowtide.com> wrote: >> In general, no -- in a typical project setup, any changes to Java code >> precipitate a rebuild and a restart of your application. >> >> There are plenty of ways to avoid this, but currently, they're only >> used in the major IDEs when debugging (e.g. while debugging an >> application, you can usually make various changes to java code, and >> then load those changes into the running application without >> restarting). This is accomplished by bootstrapping the application >> with a custom classloader (or, more likely, many, many classloaders) >> that allows the IDE to replace bytecode at various levels of >> granularity (class, method, etc). In my experience, eclipse is much >> better at this than netbeans, although the latter should approach >> parity with the 6.7 release if I've read the tea leaves properly. >> >> I know of people who have used JavaRebel >> (http://www.zeroturnaround.com/javarebel/ >> ) to implement this kind of hot code reloading in a production >> environment; apparently, it works quite well. You could try using it >> yourself -- it appears to be free for personal and open-source >> development. How it will interact with clojure and the details of its >> classloader-related implementation is anyone's guess. >> >> - Chas >> >> On Mar 10, 2009, at 2:01 AM, Javier wrote: >> >> >> >> > Hello, I'd like to thank you for providing us Clojure. This is >> > fantastic. >> >> > My background in Lisp if for several years now, just for fun, and >> > using >> > Common Lisp, mainly. >> > I have some programs in Java, and would like to use Clojure to >> > test/develop them. My question is: >> >> > Is it easy to test/load Java code in real time in Clojure while >> > developing it? For example, I have a bunch of classes I want to >> > continue >> > developing in Java, while other parts are made in Clojure. Is it >> > possible to test my modifications of the Java part in Clojure in >> > real time? >> >> > I'm using Netbeans. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---