[tcljava-dev] Re: tcljava-dev digest, Vol 1 #169 - 2 msgs
Brought to you by:
mdejong
From: Martti T. <ma...@da...> - 2006-04-04 19:33:27
|
tcl...@li... wrote: > Message: 2 > Date: Sun, 26 Mar 2006 16:10:40 -0800 > From: Mo DeJong <md...@un...> > To: tcl...@li... > Subject: Re: [tcljava-dev] Re: tjc runtime compiler > Organization: None > Reply-To: tcl...@li... > > On Wed, 15 Feb 2006 22:52:28 -0800 > Martti Tienhaara <ma...@da...> wrote: > >> The only minor problem so far is that the "-readyvar" option on >> TJC::compile never returns a result in the server. It does return >> correctly in jaclsh. > > As far as I know, the only way that would happen is if your interp > is not processing events in the Tcl event queue. If that is the case, then > you could test this by setting up and after event and then testing to > see if it got processed. See the documentation and the Shell.java class > for examples of how a thread should grab an event off the Tcl event > queue and process it. > > Mo DeJong Sorry to take so long to respond. I wrote some test programs to demo some of the problems I am having. I'll include only one example. The Test1 program works as expected when running with the TJC compiler. "test.tcl" is just a "puts hello" proc and the result is; OK ::test {} hello from test After compiling the compiler the result from the same program is; make tjc2 make tjc2.replace make tjc.install java -classpath /usr/local/lib/tcljava1.3.2/jacl.jar:/usr/local/lib/tcljava1.3.2/tcljava.jar:/usr/local/lib/tcljava1.3.2/tjc.jar:. Test1 Exception in thread "TJCThread service" java.lang.NoSuchMethodError: tjc.ProcessTclSourceCmd.setVarScalar(Ltcl/lang/Interp;Ljava/lang/String;Ltcl/lang/TclObject;ILtcl/lang/Var;I)Ltcl/lang/TclObject; at tjc.ProcessTclSourceCmd.cmdProc(ProcessTclSourceCmd.java:21) at tcl.lang.Parser.evalObjv(Parser.java:837) at tcl.lang.Interp.eval(Interp.java:2619) at tcl.lang.TJCThread.processTclSource(TJCThread.java:623) at tcl.lang.TJCThread.processEvent(TJCThread.java:504) at tcl.lang.TJCThread.run(TJCThread.java:366) at java.lang.Thread.run(Thread.java:595) I can't seem to get JSwat to work with the test program to examine the internals even though it works well with other Java programs. I am not familiar enough with the compiler internals to understand what is going on here. ------ // Test1.java import tcl.lang.*; public class Test1 { public static void main(String[] args) { try { Interp interp = new Interp(); interp.eval("source [pwd]/test.tcl"); interp.eval("package require TJC"); interp.eval("TJC::compile test -readyvar compile_ready"); interp.eval("vwait compile_ready"); interp.eval("puts $compile_ready"); interp.eval("test"); } catch ( Exception e ) { e.printStackTrace(); } } } ------ # test.tcl proc test {} { puts "hello from test" } -- Martti Tienhaara (ma...@da...) DASH Software Ltd. |