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 compiler
by Martti Tienhaara other posts by this author
Apr 4 2006 10:32PM messages near this date
[tcljava-dev] Re: What is the real JACL license? | Re: [tcljava-dev] Re: tcljava compiler
tcljava-dev-request@[...].net wrote:

The only minor problem so far is that the "-readyvar" option on
 > > TJC::compile never returns a result in the server.

 >  Exception in thread "TJCThread service" java.lang.NoSuchMethodError:

 > This is a binary compat issue with a version of the compiler that you 
 > installed already.
 > The following should fix the problem:
 > 
 > make clean
 > make all
 > make install
 > rm -rf tjc2
 > make tjc2
 > make install

Thank you. I'll remember to make clean in the future.
I'll now post a simple example of my problem with the -readyvar option.
--------
/* Test2 */
import tcl.lang.*;
public class Test2 {
     public static void main(String[] args) {
	try {
	    Interp interp = new Interp();
	    interp.eval("source [pwd]/unknown.tcl");
	    interp.eval("test");
	} catch ( Exception e ) {
	    e.printStackTrace();
	}
     }
}
----unknown.tcl----
package require TJC
proc unknown { args } {
     set command [lindex $args 0]
     source [pwd]/${command}.tcl
     set compile_ready NOT
     TJC::compile $command -readyvar compile_ready
     vwait compile_ready
     if { ! [string equal [string range $compile_ready 0 1] "OK"] } {
	puts "Compilation failed on $args ($compile_ready)"
	return
     } else {
	return [eval $args]
     }
}
-------
The ouput is "Compilation failed on test (NOT)". If I don't set the 
variable compile_ready then it is undefined. The compiler runs correctly 
and vwait takes 6 seconds just as in a direct compile but the -readyvar 
variable is never set. In a more complex example the unknown proc 
running ignores the wait and seems to compile as it goes along and the 
proc execution speeds up considerably after a while. However I suspect 
it is dangerous to allow the compiler to replace procs from another 
thread while the interpreter is executing the source proc without 
waiting for the compile to finish.

Cheers
-- 
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