summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2022-12-17 01:35:54 +0000
committerOmar Rizwan <omar@omar.website>2022-12-17 01:35:54 +0000
commiteaa57fdc7b3ac79cae4dbebd7492fa58afc99338 (patch)
treea8d08693b64affaee05f7f68eee1e479e58605d8
parentimages.folk (diff)
downloadfolk-eaa57fdc7b3ac79cae4dbebd7492fa58afc99338.tar.gz
folk-eaa57fdc7b3ac79cae4dbebd7492fa58afc99338.zip
minor cleanup
-rw-r--r--laptop.tcl2
-rw-r--r--lib/c.tcl17
-rw-r--r--main.tcl10
3 files changed, 7 insertions, 22 deletions
diff --git a/laptop.tcl b/laptop.tcl
index 5ecb17b3..f10ac106 100644
--- a/laptop.tcl
+++ b/laptop.tcl
@@ -224,14 +224,12 @@ bind . <Control-Key-n> newProgram
bind . <Command-Key-n> newProgram
set ::chs [list]
-
proc handleKeyPress {k} {
lappend ::chs $k
Retract keyboard claims the keyboard character log is /something/
Assert keyboard claims the keyboard character log is $::chs
Step
}
-
bind . <KeyPress> {handleKeyPress %K}
# also see how it's done in pi.tcl
diff --git a/lib/c.tcl b/lib/c.tcl
index e9e74d9d..cab98f4c 100644
--- a/lib/c.tcl
+++ b/lib/c.tcl
@@ -186,20 +186,3 @@ namespace eval c {
namespace export *
namespace ensemble create
}
-
-# FIXME: legacy critcl stuff below:
-
-if {![info exists ::livecprocs]} {set ::livecprocs [dict create]}
-proc livecproc {name args} {
- if {[dict exists $::livecprocs $name $args]} {
- # promote this proc
- dict set ::livecprocs $name [dict create $args [dict get $::livecprocs $name $args]]
- } else { ;# compile
- critcl::cproc $name$::stepCount {*}$args
- dict set ::livecprocs $name $args $name$::stepCount
- }
- proc $name {args} {
- set name [lindex [info level 0] 0]
- [lindex [dict values [dict get $::livecprocs $name]] end] {*}$args
- }
-}
diff --git a/main.tcl b/main.tcl
index 3dc97c68..01ef420d 100644
--- a/main.tcl
+++ b/main.tcl
@@ -78,7 +78,7 @@ namespace eval Statements { ;# singleton Statement store
set match [dict create \
parentStatementIds $parentStatementIds \
childStatementIds [list] \
- finalizer {}]
+ destructor {}]
dict set matches $matchId $match
foreach parentStatementId $parentStatementIds {
dict with Statements::statements $parentStatementId {
@@ -245,8 +245,12 @@ proc When {args} {
proc On {event body} {
if {$event eq "unmatch"} {
upvar __matchId matchId
- dict set Statements::matches $matchId finalizer $body
+ dict set Statements::matches $matchId destructor $body
} elseif {$event eq "convergence"} {
+ # FIXME: this should get retracted if gthe match is retracted (?)
+
+ # FIXME: there should be `Before convergence` also --
+ # then avoid using `On convergence` to generate statements
lappend ::log [list Do $body]
}
}
@@ -328,7 +332,7 @@ proc StepImpl {} {
}
}
- eval $finalizer
+ eval $destructor
}
dict unset Statements::matches $matchId
}