Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JAVA / TCL 1

Status
Not open for further replies.

boganr

Programmer
Apr 7, 2008
4
US
I have an application that was written in tcl a while ago. Is it possible for me to just call specific tcl procedures from my java code?
 
Yes, it's possible. It's probably not the best way go; if you can re-write the script in Java there's far less overhead. Assuming you can't, is your Tcl script "wrapped" into an executable file? If not, what java needs to call is the Tcl shell (tclsh or wish) with the script as a parameter.

_________________
Bob Rashkin
 
Do you know of any good references for converting tcl to java. I get confused on whether to use ArrayList or Hashtable for the tcl list. Converting line by line is a very slow process. Any advice would be appreciated on how to approach rewriting the tcl scripts. I'm very new to tcl.
 
Bong thanks for the reply.

Do you know of any good references for converting tcl to java. I get confused on whether to use ArrayList or Hashtable for the tcl list. Converting line by line is a very slow process. Any advice would be appreciated on how to approach rewriting the tcl scripts. I'm very new to tcl.
 
I'm afraid there's no quick conversion, at least as far as I know. I have converted many scripts from Tcl to Java but how to do it has varied in each case, depending on the application. As a general rule, I think Tcl lists are best converted to Java arrays. That is, I use lists a lot in Tcl because they seem like 'natural' constructs in Tcl. The correspondingly 'natural' set of elements in Java seems, to me, to be the array.

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top