summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2024-06-04 16:39:14 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2024-06-04 16:39:14 (GMT)
commit4fa54adbdec030bc26298f5f38d4435b4c1818b5 (patch)
tree10ccf2d9a7dab459d4d12b5cf14002175ec9e927 /doc
parent1719e80d015d40d514bb9209a921525b2d667d9c (diff)
downloadtcl-4fa54adbdec030bc26298f5f38d4435b4c1818b5.zip
tcl-4fa54adbdec030bc26298f5f38d4435b4c1818b5.tar.gz
tcl-4fa54adbdec030bc26298f5f38d4435b4c1818b5.tar.bz2
TIP 696 #defines and docs
Diffstat (limited to 'doc')
-rw-r--r--doc/CrtCommand.39
-rw-r--r--doc/CrtObjCmd.37
-rw-r--r--doc/catch.n10
-rw-r--r--doc/return.n5
4 files changed, 20 insertions, 11 deletions
diff --git a/doc/CrtCommand.3 b/doc/CrtCommand.3
index d15a920..5d25667 100644
--- a/doc/CrtCommand.3
+++ b/doc/CrtCommand.3
@@ -102,9 +102,12 @@ version 8.1 of Tcl.
.PP
\fIProc\fR must return an integer code that is expected to be one of
\fBTCL_OK\fR, \fBTCL_ERROR\fR, \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or
-\fBTCL_CONTINUE\fR. See the Tcl overview man page
-for details on what these codes mean. Most normal commands will only
-return \fBTCL_OK\fR or \fBTCL_ERROR\fR. In addition, \fIproc\fR must set
+\fBTCL_CONTINUE\fR. See the \fBreturn\fR man page for details on
+what these codes mean and the use of extended values for an extension's
+private use. Most normal commands will only return \fBTCL_OK\fR
+or \fBTCL_ERROR\fR.
+.PP
+In addition, \fIproc\fR must set
the interpreter result;
in the case of a \fBTCL_OK\fR return code this gives the result
of the command, and in the case of \fBTCL_ERROR\fR it gives an error message.
diff --git a/doc/CrtObjCmd.3 b/doc/CrtObjCmd.3
index 522f903..b28d901 100644
--- a/doc/CrtObjCmd.3
+++ b/doc/CrtObjCmd.3
@@ -132,9 +132,10 @@ that \fIobjv\fR[\fB2\fR] points at, but will not change where
.PP
\fIproc\fR must return an integer code that is either \fBTCL_OK\fR,
\fBTCL_ERROR\fR, \fBTCL_RETURN\fR, \fBTCL_BREAK\fR, or \fBTCL_CONTINUE\fR.
-See the Tcl overview man page
-for details on what these codes mean. Most normal commands will only
-return \fBTCL_OK\fR or \fBTCL_ERROR\fR.
+See the \fBreturn\fR man page for details on what these codes mean and the
+use of extended values for an extension's private use. Most normal commands
+will only return \fBTCL_OK\fR or \fBTCL_ERROR\fR.
+.PP
In addition, if \fIproc\fR needs to return a non-empty result,
it can call \fBTcl_SetObjResult\fR to set the interpreter's result.
In the case of a \fBTCL_OK\fR return code this gives the result
diff --git a/doc/catch.n b/doc/catch.n
index 8d885d4..0a2c513 100644
--- a/doc/catch.n
+++ b/doc/catch.n
@@ -30,10 +30,12 @@ return codes: 1 (\fBTCL_ERROR\fR), 2 (\fBTCL_RETURN\fR), 3 (\fBTCL_BREAK\fR),
and 4 (\fBTCL_CONTINUE\fR). Errors during evaluation of a script are indicated
by a return code of \fBTCL_ERROR\fR. The other exceptional return codes are
returned by the \fBreturn\fR, \fBbreak\fR, and \fBcontinue\fR commands
-and in other special situations as documented. Tcl packages can define
-new commands that return other integer values as return codes as well,
-and scripts that make use of the \fBreturn \-code\fR command can also
-have return codes other than the five defined by Tcl.
+and in other special situations as documented.
+New commands defined by Tcl packages as well as scripts that make
+use of the \fBreturn \-code\fR command can return other integer
+values as the return code. These must however lie outside the range
+reserved for Tcl as documented for the \fBreturn\fR command.
+
.PP
If the \fIresultVarName\fR argument is given, then the variable it names is
set to the result of the script evaluation. When the return code from the
diff --git a/doc/return.n b/doc/return.n
index 9bf1ae2..6c5b821 100644
--- a/doc/return.n
+++ b/doc/return.n
@@ -78,7 +78,10 @@ were the command \fBcontinue\fR.
\fIvalue\fR
.
\fIValue\fR must be an integer; it will be returned as the
-return code for the current procedure.
+return code for the current procedure. Values in the range
+-0x40000000 (-1073741824) to 0x40000000 (1073741824) are reserved
+for Tcl. Applications and extensions should use codes outside
+this range.
.LP
When a procedure wants to signal that it has received invalid
arguments from its caller, it may use \fBreturn -code error\fR