On Thu, Nov 13, 2008 at 11:06 AM, martin odersky <
martin.odersky@...> wrote:
> Ideally what I would wish for is the following:
>
> - being able to open a REPL with a given focus. Say I open a REPL for
> element mypackage.myobject. Then I want automatic
> imports:
>
> import mypackage._
> import myobject._
>
> so that I can directly access definitions in my focus and its environment.
This should be relatively straightforward to do.
> - when I change code, the REPL should automatically re-load it. I
> think this can be achieved using JavaRebel, but don't know enough
> about it yet.
> If we don't want to rely on JavaRebel, one could also imagine to
> re-load only if the focus file is changed. This could be done by
> wrapping the focus file in a synthetic version object, which gets
> changed everytime we edit he focus file. So we end up with many
> versions of the same class(es), each wrapped in a different version
> object.
JavaRebel works spectacularly well for this, at least with the latest
Sun JVM. My only concerns about depending on it is that it's closed
source, and it's not at all clear to me what the "free" one year Scala
license actually permits. For instance, it's not at all clear to me
whether or not it's distributable by EPFL or anyone else as a
component of the Eclipse plugin.
Ultimately it's your call on the licensing issue. From my point of
view, I would either want there to be no issues with bundling
JavaRebel with the plugin at zero cost now and into the future (ie.
well beyond one year); or have the JavaRebel functionality shipped as
an independent component separately from the rest of the Scala plugin,
in which case it would probably make sense if ZeroTurnaround could
develop and distribute it themselves.
> The current console support does neither (and, besides, it does not
> work on Windows; the console window closes immediately after being
> opened).
Yes, that's unfortunate ... I'm not sure what the problem is, and I'd
be grateful for any help anyone can give me here.
> I believe if we can do such a thing, it would be really useful. It
> would be a point where the Scala plugin would do something clearly
> better than the Java plugin. For the first time, we'd do more than
> catching up!
Agreed!
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype: milessabin