From: Brian S. <bs...@bs...> - 2002-11-03 20:59:45
|
On BeanShell: The first prototype of an interpreter-based REPL for DrJava that I did was actually based on BeanShell. I switched to DynamicJava for reasons I don't remember at the moment -- it might have been language feature support they had at the time, perhaps lacking anonymous inner classes or something. Or it may have been an ease of integration issue, or even licensing at that time (I think they used to have a different license). Anyway, BeanShell is certainly a more living project than DynamicJava and it sounds like it has improved some since I last checked it out. It sounds like not a bad idea to move to it, although the range of improvements sound like it wouldn't be worth your effort to spend too much time on it. On the other hand, it shouldn't be too hard to implement. The REPL was designed from the beginning to allow swapping out the interpeter. Pretty much, you should be able to implement model.repl.JavaInterpreter and swap that in instead. (I think there is a bit of DynamicJava-specific code in other places, like handling the returned values/error messages, but it shouldn't be hard to clean up.) One small concern to point out: Seems like they blew it with regard to returning the "no result" value, like DynamicJava did (before I fixed it in our subclass). From their docs: If an evaluation of a statement or expression yields a "void" value; such as would be the case for something like a for-loop or a void type method invocation, eval() returns null. This same problem in DynamicJava was the reason, if you left off the semicolon, you used to get "null" as the result for void-returning statements. Anyhow, just wanted to throw in my few cents. -brian |