summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-06-26 18:02:18 +0000
committerOmar Rizwan <omar@omar.website>2023-06-26 18:03:13 +0000
commit9534be3bd9e09e1f491faa9d6d89d4d1dfd16d96 (patch)
treee1ab05dcf7572b51443f8acf1bc39d636e7ee477
parentScope in README (diff)
downloadfolk-9534be3bd9e09e1f491faa9d6d89d4d1dfd16d96.tar.gz
folk-9534be3bd9e09e1f491faa9d6d89d4d1dfd16d96.zip
Don't use variables as parameters in negation
(since negations don't actually get those variables bound) Fixes negation with variables
-rw-r--r--main.tcl2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.tcl b/main.tcl
index 87411250..3b6faea7 100644
--- a/main.tcl
+++ b/main.tcl
@@ -109,12 +109,12 @@ proc When {args} {
lset pattern $i [uplevel [list subst $word]]
}
}
- lappend argNames {*}$varNamesWillBeBound
if {$negate} {
set negateBody [list if {[llength $__matches] == 0} $body]
uplevel [list Say when the collected matches for $pattern are /__matches/ [list [list {*}$argNames __matches] $negateBody] with environment $argValues]
} else {
+ lappend argNames {*}$varNamesWillBeBound
uplevel [list Say when {*}$pattern [list $argNames $body] with environment $argValues]
}
}