ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcljava-dev
tcljava-dev
[tcljava-dev] Re: tcljava-dev digest, Vol 1 #169 - 2 msgs
by Martti Tienhaara other posts by this author
Apr 4 2006 1:07PM messages near this date
Re: [tcljava-dev] Re: tcljava compiler | Re: [tcljava-dev] Re: tcljava-dev digest, Vol 1 #169 - 2 msgs
tcljava-dev-request@[...].net wrote:

>  Message: 2
>  Date: Sun, 26 Mar 2006 16:10:40 -0800
>  From: Mo DeJong <mdejong@[...].org>
>  To: tcljava-dev@[...].net
>  Subject: Re: [tcljava-dev] Re: tjc runtime compiler
>  Organization: None
>  Reply-To: tcljava-dev@[...].net
>  
>  On Wed, 15 Feb 2006 22:52:28 -0800
>  Martti Tienhaara <martti@[...].ca> 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 (martti@dash.ca)
DASH Software Ltd.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
tcljava-dev mailing list
tcljava-dev@[...].net
https://lists.sourceforge.net/lists/listinfo/tcljava-dev
Thread:
Martti Tienhaara
Mo DeJong

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved