summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2024-07-10 07:32:39 -0400
committerDavid Thompson <dthompson2@worcester.edu>2024-07-10 07:32:39 -0400
commita08647c5a9ce4fd52077c18c4667df593fccf196 (patch)
tree532c281f29e47a13c86a6a7b5a0d4bbdaa8e1be4
parent3a06876f1c66908d77da410560461117e40c651a (diff)
A few more fixes for propagator post.
-rw-r--r--posts/2024-07-03-frp-with-propagators.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/posts/2024-07-03-frp-with-propagators.md b/posts/2024-07-03-frp-with-propagators.md
index 8c109f2..ad7df44 100644
--- a/posts/2024-07-03-frp-with-propagators.md
+++ b/posts/2024-07-03-frp-with-propagators.md
@@ -603,11 +603,12 @@ We need to perform a few operations with ephemerals:
1) Test if one ephemeral is *fresher* (more recent) than another
-2) Compose the timestamps from several inputs to form an aggregate
+2) Merge two ephemerals when cell content is added
+
+3) Compose the timestamps from several inputs to form an aggregate
timestamp for an output, but only if all timestamps for each distinct
identifier match (no mixing of fresh and stale values)
-3) Merge two ephemerals when cell content is added
```scheme
(define (ephemeral-fresher? a b)
@@ -626,7 +627,8 @@ identifier match (no mixing of fresh and stale values)
(cond
((nothing? old) new)
((nothing? new) old)
- (else (if (ephemeral-fresher? new old) new old))))
+ ((ephemeral-fresher? new old) new)
+ (else old)))
(define (merge-ephemeral-timestamps ephemerals)
(define (adjoin-keys alist keys)
@@ -1032,7 +1034,7 @@ constraint propagators:
(define (build)
(r:rgb->hsv rgb hsv)
(r:hsv->rgb hsv rgb))
- (constraint-propagator 'r:components<->hsv (list rgb hsv) build))
+ (constraint-propagator 'r:rgb<->hsv (list rgb hsv) build))
```
At long last, we are ready to define the UI! Here it is: