diff options
author | dgp <dgp@users.sourceforge.net> | 2008-12-09 20:16:29 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-12-09 20:16:29 (GMT) |
commit | d50d702634fc6eb5493a179a01cd0f9c1e57c9c9 (patch) | |
tree | 38198e5255a92dc734f2fbd7319794c93938e06a /doc/interp.n | |
parent | bf5bd60be593f40dbbce0627ef593839cde67a5b (diff) | |
download | tcl-d50d702634fc6eb5493a179a01cd0f9c1e57c9c9.zip tcl-d50d702634fc6eb5493a179a01cd0f9c1e57c9c9.tar.gz tcl-d50d702634fc6eb5493a179a01cd0f9c1e57c9c9.tar.bz2 |
TIP #337 IMPLEMENTATION
* doc/BackgdErr.3: Converted internal routine
* doc/interp.n: TclBackgroundException() into public routine
* generic/tcl.decls: Tcl_BackgroundException().
* generic/tclEvent.c:
* generic/tclInt.decls:
* generic/tclDecls.h: make genstubs
* generic/tclIntDecls.h:
* generic/tclStubInit.c:
* generic/tclIO.c: Update callers.
* generic/tclIOCmd.c:
* generic/tclInterp.c:
* generic/tclTimer.c:
*** POTENTIAL INCOMPATIBILITY only for extensions using the converted
internal routine ***
Diffstat (limited to 'doc/interp.n')
-rw-r--r-- | doc/interp.n | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/doc/interp.n b/doc/interp.n index c986519..8e06fd3 100644 --- a/doc/interp.n +++ b/doc/interp.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: interp.n,v 1.41 2008/10/17 10:22:25 dkf Exp $ +'\" RCS: @(#) $Id: interp.n,v 1.42 2008/12/09 20:16:29 dgp Exp $ '\" .so man.macros .TH interp n 8.6 Tcl "Tcl Built-In Commands" @@ -138,12 +138,12 @@ as the current names of the commands). .TP \fBinterp bgerror \fIpath\fR ?\fIcmdPrefix\fR? . -This command either gets or sets the current background error handler +This command either gets or sets the current background exception handler for the interpreter identified by \fIpath\fR. If \fIcmdPrefix\fR is -absent, the current background error handler is returned, and if it is +absent, the current background exception handler is returned, and if it is present, it is a list of words (of minimum length one) that describes -what to set the interpreter's background error to. See the -\fBBACKGROUND ERROR HANDLING\fR section for more details. +what to set the interpreter's background exception handler to. See the +\fBBACKGROUND EXCEPTION HANDLING\fR section for more details. .TP \fBinterp\fR \fBcancel \fR?\fB\-unwind\fR? ?\fB\-\|\-\fR? ?\fIpath\fR? ?\fIresult\fR? .VS 8.6 @@ -395,12 +395,12 @@ does not have to be equal to \fIsrcCmd\fR. .TP \fIslave \fBbgerror\fR ?\fIcmdPrefix\fR? . -This command either gets or sets the current background error handler +This command either gets or sets the current background exception handler for the \fIslave\fR interpreter. If \fIcmdPrefix\fR is -absent, the current background error handler is returned, and if it is +absent, the current background exception handler is returned, and if it is present, it is a list of words (of minimum length one) that describes -what to set the interpreter's background error to. See the -\fBBACKGROUND ERROR HANDLING\fR section for more details. +what to set the interpreter's background exception handler to. See the +\fBBACKGROUND EXCEPTION HANDLING\fR section for more details. .TP \fIslave \fBeval \fIarg \fR?\fIarg ..\fR? . @@ -748,8 +748,8 @@ This option (common for all limit types) specifies (if non-empty) a Tcl script to be executed in the global namespace of the interpreter reading and writing the option when the particular limit in the limited interpreter is exceeded. The callback may modify the limit on the interpreter if it wishes the limited -interpreter to continue executing. If the callback generates an error, it is -reported through the background error mechanism (see \fBBACKGROUND ERROR +interpreter to continue executing. If the callback generates an exception, it is +reported through the background exception mechanism (see \fBBACKGROUND EXCEPTION HANDLING\fR). Note that the callbacks defined by one interpreter are completely isolated from the callbacks defined by another, and that the order in which those callbacks are called is undefined. @@ -792,21 +792,23 @@ these conditions, it should hide the \fBinterp\fR command in the child and then use aliases and the \fBinterp invokehidden\fR subcommand to provide such access as it chooses to the \fBinterp\fR command to the limited master as necessary. -.SH "BACKGROUND ERROR HANDLING" +.SH "BACKGROUND EXCEPTION HANDLING" .PP -When an error happens in a situation where it cannot be reported directly up +When an exception happens in a situation where it cannot be reported directly up the stack (e.g. when processing events in an \fBupdate\fR or \fBvwait\fR call) -the error is instead reported through the background error handling mechanism. -Every interpreter has a background error handler registered; the default error +the exception is instead reported through the background exception handling mechanism. +Every interpreter has a background exception handler registered; the default exception handler arranges for the \fBbgerror\fR command in the interpreter's global -namespace to be called, but other error handlers may be installed and process -background errors in substantially different ways. +namespace to be called, but other exception handlers may be installed and process +background exceptions in substantially different ways. .PP -A background error handler consists of a non-empty list of words to which will +A background exception handler consists of a non-empty list of words to which will be appended two further words at invocation time. The first word will be the -error message string, and the second will a dictionary of return options (this -is also the sort of information that can be obtained by trapping a normal -error using \fBcatch\fR of course.) The resulting list will then be executed +interpreter result at time of the exception, typically an error message, +and the second will be the dictionary of return options at the time of +the exception. These are the same values that \fBcatch\fR can capture +when it controls script evaluation in a non-background situation. +The resulting list will then be executed in the interpreter's global namespace without further substitutions being performed. .SH CREDITS @@ -849,7 +851,7 @@ set i [\fBinterp create\fR] } .CE .SH "SEE ALSO" -bgerror(n), load(n), safe(n), Tcl_CreateSlave(3), Tcl_Eval(3) +bgerror(n), load(n), safe(n), Tcl_CreateSlave(3), Tcl_Eval(3), Tcl_BackgroundException(3) .SH KEYWORDS alias, master interpreter, safe interpreter, slave interpreter '\"Local Variables: |