syndicate-2017/racket/syndicate/examples/example-wildcard-assertion-...

23 lines
777 B
Racket
Raw Permalink Normal View History

#lang syndicate/core
2016-02-03 04:01:08 +00:00
;; Demonstrate wildcard assertions.
;; One actor asserts everything except inbound/outbound assertions (which break
2016-02-03 04:01:08 +00:00
;; the ground VM). It therefore *subscribes* to everything too.
2016-04-01 23:53:46 +00:00
(require syndicate/pretty)
2016-02-03 04:01:08 +00:00
(actor (lambda (e s)
2016-02-03 04:01:08 +00:00
(printf "Subscriber - Aggregate\n")
2016-04-01 23:53:46 +00:00
(syndicate-pretty-print s)
2016-02-03 04:01:08 +00:00
(printf "Subscriber - Patch\n")
2016-04-01 23:53:46 +00:00
(syndicate-pretty-print e)
2016-02-03 04:01:08 +00:00
(newline)
(if (patch? e)
(transition (update-interests s e) '())
#f))
trie-empty
2016-02-03 04:01:08 +00:00
(patch-seq (assert ?)
(retract (outbound ?))
(retract (observe (inbound ?)))
(retract (inbound ?)) ;; not actually required for the purposes of this demo
))