syndicate-2017/racket/syndicate/examples/example-meta-echo2.rkt

15 lines
496 B
Racket
Raw Normal View History

#lang syndicate/core
;; The actor should receive a single event adding an (inbound 'x) assertion.
2016-04-01 23:53:46 +00:00
(require syndicate/pretty)
2017-02-25 16:16:25 +00:00
(dataspace-actor
(actor (lambda (e counter)
(and e
(let ((new-counter (+ counter 1)))
2016-04-01 23:53:46 +00:00
(printf "Received event ~a:\n~a\n" new-counter (syndicate-pretty-print->string e))
(transition (+ counter 1) '()))))
0
(list (patch-seq (sub (inbound 'x))
(assert (outbound 'x))))))