Tcl code section
PDL driver Tcl code is a specific type of programming. Basically, the available Tcl commands for performing I/O operations are commands that set up the operations. They are not represented as commands for performing the operation. The actual operation is deferred to when control returns from the Tcl function. The Tcl invocation chain must be empty at any point where the driver might be required to perform I/O.
To maintain control at the Tcl level, a continuation is passed to the command that sets up the operation. This instructs it to invoke the named Tcl procedure when the operation completes under the appropriate circumstances.
Specific continuations are:
-
ok
: If the operation is successful, then theok
continuation is called with a particular argument, depending on the operation. -
error
: If an error happens, then theerror
continuation is called. -
timeout
: Thetimeout
continuation is called if processes happen too slowly.
Continuation procedures and the driver entry points are always called with a single argument. The argument is a TclX-style keylist containing arguments to the procedure. The arguments are passed as a structured keylist to write forward-compatible driver code.