diff options
| author | Omar Rizwan <omar@omar.website> | 2023-06-26 18:02:18 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-06-26 18:03:13 +0000 |
| commit | 9534be3bd9e09e1f491faa9d6d89d4d1dfd16d96 (patch) | |
| tree | e1ab05dcf7572b51443f8acf1bc39d636e7ee477 | |
| parent | Scope in README (diff) | |
| download | folk-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.tcl | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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] } } |
