Re: [tcljava-user] Adding a JACL 1.3.1 package
Brought to you by:
mdejong
From: Joe W. <jwe...@ci...> - 2004-06-29 22:13:15
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> <title></title> </head> <body> Thanks for the tips.<br> It's a Java-code extension.<br> I'll try the TCLLIBPATH trick.<br> <br> BTW - is there a more recent version of this stuff?<br> The version I downloaded (1.3.1 from SF) doesn't even compile without my commenting out the CObject stuff.<br> Makes it seem almost noone is using this package.<br> <br> --> joe w.<br> <br> Tom Poindexter wrote:<br> <blockquote type="cite" cite="mid...@ny..."> <pre wrap="">On Mon, Jun 28, 2004 at 12:18:21PM -0700, Joe Weisblatt wrote: </pre> <blockquote type="cite"> <pre wrap="">I'd like to add some JACL commands, but I'm not really following how to have it load without changing JACL sources. If I hard-wire my command, it works fine. But I'd like to do it just by adding a tcl/lang/library/mypkg/pkgIndex.tcl, and I can't seem to get JACL to find that file. I'm assuming the problem is that in the "package unknown" procedure, the "glob" trying to find library/*/pkgIndex.tcl won't work on the auto_path entry of <a class="moz-txt-link-rfc2396E" href="resource:/tcl/lang/library">"resource:/tcl/lang/library"</a> because Java's getResource*() methods won't do patterns. </pre> </blockquote> <pre wrap=""><!----> Is your package coded in Java as a Jacl extension, or simply a set of Tcl procedures? For Tcl-only packages, it should be easy enough to make a directory in your Jacl library (i.e., where the jacl.jar and tcljava.jar files exists), and drop in your Tcl package with an appropriate pkgIndex.tcl file. The trick is that you need to pass the TCLLIBPATH as a property when starting Jacl. I do this with a custom jaclsh. You should be able to do a similar scheme with a compiled Java extension, where your pkgIndex.tcl loads the extension. Or, you might be interested in tyring out my 'Hyde' package. Hyde lets you code Java extensions in your Tcl code, compiles and loads the bytecodes on the fly. Compilation is skipped if the Java code has already been compiled and stored in a bytecode cache file. Hyde itself is just a Tcl package that sits in my Jacl directory, /usr/local/lib/tcljava1.3.1/hyde-1.3 I've never formally released Hyde yet, but I can mail you a copy to try out if you are interested. I'm attaching my custom jaclsh script also. It assumes that Jacl is installed in the /usr/local tree; if not, it should be easy to modify, just adjust the paths for 'prefix' and 'JAVA'. It also can be linked as 'wisk', to start Jacl/Swank, if you have the Swank jar. </pre> </blockquote> <br> </body> </html> |