diff --git a/racket/syndicate/core.rkt b/racket/syndicate/core.rkt index 74ec045..a0e4fb1 100644 --- a/racket/syndicate/core.rkt +++ b/racket/syndicate/core.rkt @@ -11,6 +11,9 @@ (struct-out process) + assertion-struct + message-struct + (struct-out seal) sealof @@ -116,6 +119,12 @@ ;; A PID is a Nat. ;; A Label is a PID or 'meta. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Thin veneers over `struct` for declaring intent. + +(define-syntax-rule (assertion-struct item ...) (struct item ... #:prefab)) +(define-syntax-rule (message-struct item ...) (struct item ... #:prefab)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Seals are used by protocols to prevent the routing tries from ;; examining internal structure of values. diff --git a/racket/syndicate/examples/actor/box-and-client.rkt b/racket/syndicate/examples/actor/box-and-client.rkt index 1cc7e6b..8618f11 100644 --- a/racket/syndicate/examples/actor/box-and-client.rkt +++ b/racket/syndicate/examples/actor/box-and-client.rkt @@ -1,8 +1,8 @@ #lang syndicate ;; Simple mutable box and count-to-infinity box client. -(struct set-box (new-value) #:transparent) -(struct box-state (value) #:transparent) +(message-struct set-box (new-value)) +(assertion-struct box-state (value)) (spawn (field [current-value 0]) (assert (box-state (current-value)))