From 1a63a2c35d387f381dce962a55b5368b56803ac8 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 28 May 2014 16:30:50 -0400 Subject: [PATCH] gestalt-accepts? --- minimart/core.rkt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/minimart/core.rkt b/minimart/core.rkt index f81025a..31fac58 100644 --- a/minimart/core.rkt +++ b/minimart/core.rkt @@ -25,6 +25,7 @@ sub pub + gestalt-accepts? spawn send @@ -73,6 +74,10 @@ (define (sub p #:meta-level [ml 0] #:level [l 0]) (simple-gestalt #f p l ml)) (define (pub p #:meta-level [ml 0] #:level [l 0]) (simple-gestalt #t p l ml)) +(define (gestalt-accepts? g m) + (match-define (message b ml f?) m) + (not (set-empty? (gestalt-match-value g b ml f?)))) + (define (spawn behavior state [gestalt (gestalt-empty)]) (process gestalt behavior state)) (define (send body #:meta-level [ml 0]) (message body ml #f)) (define (feedback body #:meta-level [ml 0]) (message body ml #t))