Hi,
I have a few beginner's question about ParTcl.
I am trying to embed ParTcl into a PIR application, which seems to work
quite nicely, except that I have not yet figured out how to do certain
things.
=====
1) Is there a way to reset the Tcl interpreter between invocations?
.sub _main @MAIN
load_bytecode "languages/tcl/lib/tcllib.pbc"
$P1 = compreg 'TCL'
$P0 = compile $P1, 'set a 1; puts $a'
$P0()
# now reset the TCL interpreter somehow
$P0 = compile $P1, 'incr a; puts $a'
$P0()
.end
====
2) I can access TCL variables from PIR using
find_global "_Tcl", "__read"
Is there any way to access Parrot globals from TCL ( other than doing
inline PIR to assign them to a TCL variable) ?
====
3) Is there a way to pass parameters to the subroutine produced by the
TCL compiler ?
.sub _main @MAIN
load_bytecode "languages/tcl/lib/tcllib.pbc"
$P1 = compreg 'TCL'
$P0 = compile $P1, 'puts $first_parameter'
$P0('hello')
# now reset the TCL interpreter somehow
.end
====
4) Is there a way to pass parameters from TCL to inline PIR code ?
My current work-around is to put them into variables and access those
using "__Tcl"::"__read".
====
Thanks,
Thilo