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

15 lines
490 B
Racket

#lang prospect
;; The actor should receive a single event adding the (at-meta x) assertion.
(require prospect/pretty)
(spawn-network
(spawn (lambda (e counter)
(and e
(let ((new-counter (+ counter 1)))
(printf "Received event ~a:\n~a\n" new-counter (prospect-pretty-print->string e))
(transition (+ counter 1) '()))))
0
(list (patch-seq (sub 'x #:meta-level 1)
(assert (at-meta 'x))))))