summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-26 10:24:57 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-26 10:24:57 (GMT)
commit30c8fdf6ad1da3979ac851dfe46e1c45636fd427 (patch)
tree69299f868ebc0d1754a77d462f33797fe06821a9
parent52f762e4fcb9a31c8866c6986198adb282fa4e7a (diff)
downloadtcl-30c8fdf6ad1da3979ac851dfe46e1c45636fd427.zip
tcl-30c8fdf6ad1da3979ac851dfe46e1c45636fd427.tar.gz
tcl-30c8fdf6ad1da3979ac851dfe46e1c45636fd427.tar.bz2
Tighten up expr(n) wording. [Bug 1027849]
-rw-r--r--ChangeLog5
-rw-r--r--doc/expr.n19
2 files changed, 16 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 118c799..fcb9cad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-26 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/expr.n: Clarified that non-num/non-bool literals require
+ quoting. [Bug 1027849]. Also listed booleans as acceptable values.
+
2004-10-26 Kevin B. Kenny <kennykb@acm.org>
* library/clock.tcl (FreeScan): Fixed a bug that caused relative
diff --git a/doc/expr.n b/doc/expr.n
index 3519327..d3135c8 100644
--- a/doc/expr.n
+++ b/doc/expr.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: expr.n,v 1.16 2004/10/08 21:39:16 dkf Exp $
+'\" RCS: @(#) $Id: expr.n,v 1.17 2004/10/26 10:24:59 dkf Exp $
'\"
.so man.macros
.TH expr n 8.5 Tcl "Tcl Built-In Commands"
@@ -51,9 +51,10 @@ ways accepted by an ANSI-compliant C compiler (except that the
\fBf\fR, \fBF\fR, \fBl\fR, and \fBL\fR suffixes will not be permitted in
most installations). For example, all of the
following are valid floating-point numbers: 2.1, 3., 6e4, 7.91e+16.
-If no numeric interpretation is possible, then an operand is left
-as a string (and only a limited set of operators may be applied to
-it).
+If no numeric interpretation is possible (note that all literal
+operands that are not numeric or boolean must be quoted with either
+braces or with double quotes), then an operand is left as a string
+(and only a limited set of operators may be applied to it).
.PP
On 32-bit systems, integer values MAX_INT (0x7FFFFFFF) and MIN_INT
(-0x80000000) will be represented as 32-bit values, and integer values
@@ -64,22 +65,24 @@ Operands may be specified in any of the following ways:
.IP [1]
As a numeric value, either integer or floating-point.
.IP [2]
+As a boolean value, using any form understood by \fBstring is boolean\fR.
+.IP [3]
As a Tcl variable, using standard \fB$\fR notation.
The variable's value will be used as the operand.
-.IP [3]
+.IP [4]
As a string enclosed in double-quotes.
The expression parser will perform backslash, variable, and
command substitutions on the information between the quotes,
and use the resulting value as the operand
-.IP [4]
+.IP [5]
As a string enclosed in braces.
The characters between the open brace and matching close brace
will be used as the operand without any substitutions.
-.IP [5]
+.IP [6]
As a Tcl command enclosed in brackets.
The command will be executed and its result will be used as
the operand.
-.IP [6]
+.IP [7]
As a mathematical function whose arguments have any of the above
forms for operands, such as \fBsin($x)\fR. See below for a list of defined
functions.