On Tue, 27 Mar 2001, Christian Krone wrote:
> > I don't know if we should even put the incr Jacl code
> > in the same tree as Jacl. Why not have another tree
> > with its own ./configure and so on? That is what
> > Bruce did with Swank (Tk via Swing).
>
> I think it is less effort to populate the existing tree
> instead of creating a new one. And when some day IncrTcl
> will be integrated into the Tcl language, we have the
> stuff already there :-)
Well, it is less effort for you. But what about the
next person that wants to extend Jacl? Are we going
to put every extension in the tcljava CVS module?
> Anyway, does the Swank sources belong to tcljava? Or do
> they have their own project? Or do they have their
> own tree below tcljava/src and you can give a
> command line option --enable-swank to configure?
Swank uses its own tree and ./configure script.
You pass a --with-tcljava=DIR option to the
swank configure script and it pulls info
like where javac lives out of tcljavaConfig.sh.
> > > But how would the new classes be loaded into the Jacl interpreter?
> > >From the users point of view, it should be as easy as
> > "package require IncrTcl".
>
> You mean "package require Itcl", don't you?
Yup.
> > Your implementation would most likely extend
> > src/tcljava/tcl/lang/Extension.java.[...] The hard part
> > might be getting "package require ..." to work
> > when the ... package is in a .jar like incrtcl.jar.
> > I think the best way to implement that is to use
> > the manifest file to list what Tcl packages are
> > available in a given .jar file and the java class
> > name.
>
> This looks like I should take a break on the Incr sources
> and should spend some time on the package command...
> I had some hopes that I can work around it, but they
> are gone now.
You can work around it as long as you don't put the
files into a .jar. As long as a pkgIndex.tcl for
your "Itcl" package can be found, it will get loaded
by a "package require Itcl". Just make sure that
dir appears on the auto_path Tcl variable. For a
nasty example of how I hacked "package require java"
support into Jacl, see src/jacl/tcl/lang/JaclLoadJava.java
(be warned, it is a bit ugly). Don't worry about the
finished product yet, the package in a .jar stuff is
just how to code is delivered. Getting code to deliver
in the first place is more important.
Mo
|