Inherits From:
ITKInterp : NSObject
Conforms To:
NSObject (NSObject)
NSCoding (ITKInterp)
Declared in: itkTcl/ITKTclInterp.h
The generic methods for evaluating scripts and accessing variables use the class ITKTclObj for wrapping Tcl values as Objective-C objects. In some situations this generic, ITKValue-based API can be overkill, e.g. when you are running in Tcl and just want to evaluate a script in another ITKTclInterp instance. In this case, it is easiest (and most efficient) to use a method like eval:, which avoids any conversion overhead by simply passing raw Tcl values between interpreters.
All methods that expect a variable name as an argument will interpret that name as referencing a Tcl array element if it ends in a parenthesized index.
mainInterp
Returns the first instance of ITKTclInterp created by the application, creating one if none exists.
eval:
(TclObj)script Evaluates script in the currently executing scope of the receiving interpreter and returns the result. Raises an exception if an error occurs. This method is most conveniently called from Tcl rather than from Objective-C.
globEval:
(TclObj)script Evaluates script in the global scope of the receiving interpreter and returns the result. Raises an exception if an error occurs. This method is most conveniently called from Tcl rather than from Objective-C.
nativeInterp
Returns the Tcl_Interp * representing the interpreter for use with the low-level Tcl API exported by tcl.h. The Objective-C API should be sufficient for almost every purpose, though.
unsetVariable:
(NSString *)variable global:
(BOOL)global Deletes the variable variable from the interpreter's name space, analogous to the Tcl unset command. If global is YES, looks for variable in the global scope, otherwise in the currently executing scope.