summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2022-03-16 07:44:11 +0000
committerOmar Rizwan <omar@omar.website>2022-03-16 07:44:11 +0000
commitc31c19676b3433697c1af147457d2df989059d83 (patch)
tree44c0cb8459d3126c5ee5d422b2212938b2d53042
parentstart refactoring reactive core (diff)
downloadfolk-c31c19676b3433697c1af147457d2df989059d83.tar.gz
folk-c31c19676b3433697c1af147457d2df989059d83.zip
more refactoring. inner When doesn't work
-rw-r--r--folk.tcl34
1 files changed, 12 insertions, 22 deletions
diff --git a/folk.tcl b/folk.tcl
index 0b68992d..eb2f7366 100644
--- a/folk.tcl
+++ b/folk.tcl
@@ -18,11 +18,7 @@ proc When {args} {
lappend ::whens [list $clause $cb]
}
-proc Top {cb} {
- # you can't run Claim/When/etc outside a valid Folk context --
- # this is a root context so you can hardcode stuff
-
-}
+# TODO: top/prelude/boot context ?
proc runWhen {clause cb match} {
dict with match $cb
@@ -68,20 +64,6 @@ proc frame {} {
}
}
-# Top {
-# Claim the fox is out
-# Claim the dog is out
-
-# When the /animal/ is out {
-# puts "there is a $animal out there somewhere"
-# Claim the $animal is around
-
-# When the /animal/ is around {
-# puts "hello $animal"
-# }
-# }
-# }
-
# we want to be able to asynchronously receive statements
# we want to be able to asynchronously share statements(?)
proc accept {chan addr port} {
@@ -127,14 +109,22 @@ after 0 { Step {} }
after 200 {
Step {
- puts assume1
- Wish rectangle blue
+ puts Step1
+ Claim the fox is out
+ Claim the dog is out
+ When the /animal/ is out {
+ When the /animal/ is around {
+ puts "the $animal is around"
+ }
+ puts "there is a $animal out there somewhere"
+ Claim the $animal is around
+ }
}
}
after 400 {
Step {
- puts assume2
+ puts Step2
Wish rectangle orange
}
}