From 75c374a07d79435f3b31078922fffc7b470cfb24 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Sun, 29 Jan 2023 17:53:35 -0500 Subject: Guard destructor bc outer/inner execution order is not defined --- virtual-programs/with-all.folk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'virtual-programs') diff --git a/virtual-programs/with-all.folk b/virtual-programs/with-all.folk index 6c58311f..da40420b 100644 --- a/virtual-programs/with-all.folk +++ b/virtual-programs/with-all.folk @@ -10,7 +10,11 @@ When when the collected matches for /clause/ are /matchesVar/ /body/ with enviro foreach varName $varNames { dict set match $varName [set $varName] } dict set ::collectedMatches $clause $match true - On unmatch { dict unset ::collectedMatches $clause $match } + On unmatch { + if {[dict exists $::collectedMatches $clause]} { + dict unset ::collectedMatches $clause $match + } + } } When $::nodename has step count /c/ { set matchId $::matchId -- cgit v1.2.3