aboutsummaryrefslogtreecommitdiff
path: root/jim_tcl.txt
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2023-11-23 08:08:26 +1000
committerSteve Bennett <steveb@workware.net.au>2024-02-02 11:22:30 +1000
commit172b5c42010d329e84e498e9347c7f09c9b923e2 (patch)
treee0e81908c5c84ece8ef581e7037114e3ae4fd380 /jim_tcl.txt
parenta227bf74d2fc5013fed3d3de025086c586bc950c (diff)
downloadjimtcl-172b5c42010d329e84e498e9347c7f09c9b923e2.zip
jimtcl-172b5c42010d329e84e498e9347c7f09c9b923e2.tar.gz
jimtcl-172b5c42010d329e84e498e9347c7f09c9b923e2.tar.bz2
expr: better error message on nested $()
And explain in the manual that it isn't allowed. Fixes: #285 Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim_tcl.txt')
-rw-r--r--jim_tcl.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/jim_tcl.txt b/jim_tcl.txt
index 8684ed9..2c5409e 100644
--- a/jim_tcl.txt
+++ b/jim_tcl.txt
@@ -2489,6 +2489,23 @@ The following two are identical.
set x $(3 * 2 + 1)
----
+However note that the expr shorthand syntax may not be nested in an expression.
+This is to prevent the common mistake of writing:
+
+----
+ if {$(1 + 2) == 3) {
+ ...
+ }
+----
+
+rather than:
+
+----
+ if {(1 + 2) == 3) {
+ ...
+ }
+----
+
file
~~~~
+*file* 'option name ?arg\...?'+