149
150
151
152
153
154
155
156
157
158
159
160
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
-
+
+
+
+
+
+
+
+
|
set handle [tcc4tcl::new]
$handle proc callToTcl {Tcl_Interp* ip int a int b} int {
set retval [expr {$a + $b}]
return $retval
}
$handle cwrap callToTcl {Tcl_Interp* ip int a int b} int
puts [$handle code]
$handle go
if {[callToTcl 3 5] != 8} {
error "3 + 5 is 8, not [callToTcl 3 5]"
}
set handle [tcc4tcl::new]
$handle proc callToTcl1 {} float {
return 0.1
}
$handle cwrap callToTcl1 {} float
$handle go
puts [callToTcl1]
|