diff options
| author | Omar Rizwan <omar@omar.website> | 2022-12-17 01:35:54 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2022-12-17 01:35:54 +0000 |
| commit | eaa57fdc7b3ac79cae4dbebd7492fa58afc99338 (patch) | |
| tree | a8d08693b64affaee05f7f68eee1e479e58605d8 | |
| parent | images.folk (diff) | |
| download | folk-eaa57fdc7b3ac79cae4dbebd7492fa58afc99338.tar.gz folk-eaa57fdc7b3ac79cae4dbebd7492fa58afc99338.zip | |
minor cleanup
| -rw-r--r-- | laptop.tcl | 2 | ||||
| -rw-r--r-- | lib/c.tcl | 17 | ||||
| -rw-r--r-- | main.tcl | 10 |
3 files changed, 7 insertions, 22 deletions
@@ -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 @@ -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 - } -} @@ -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 } |
