;;; SPDX-License-Identifier: LGPL-3.0-or-later
;;; SPDX-FileCopyrightText: Copyright © 2010-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>

#lang syndicate

(assertion-struct greeting (text))

(spawn #:name "A" (assert (greeting "Hi from outer space!")))
(spawn #:name "B" (on (asserted (greeting $t))
                      (printf "Outer dataspace: ~a\n" t)))

(dataspace #:name "C"
  (spawn #:name "D" (assert (outbound (greeting "Hi from inner!"))))
  (spawn #:name "E" (on (asserted (inbound (greeting $t)))
                        (printf "Inner dataspace: ~a\n" t))))
