Browse Source

add1-simple.rkt

pr/32
Tony Garnock-Jones 4 years ago
parent
commit
d51a513f8b
  1. 13
      racket/syndicate/examples/actor/add1-simple.rkt

13
racket/syndicate/examples/actor/add1-simple.rkt

@ -0,0 +1,13 @@
#lang syndicate
;; Trivial example program to demonstrate tracing
(assertion-struct one-plus (n m))
(spawn #:name 'add1-server
(during/spawn (observe (one-plus $n _))
#:name (list 'solving 'one-plus n)
(assert (one-plus n (+ n 1)))))
(spawn #:name 'client-process
(stop-when (asserted (one-plus 3 $value))
(printf "1 + 3 = ~a\n" value)))
Loading…
Cancel
Save