From f788caf754164b66522661b7856163115aef2fb0 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 13 May 2014 23:08:42 -0400 Subject: [PATCH] More exports and utilities --- minimart/core.rkt | 12 +++++++++++- minimart/gestalt.rkt | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/minimart/core.rkt b/minimart/core.rkt index dffe459..0bf52c4 100644 --- a/minimart/core.rkt +++ b/minimart/core.rkt @@ -13,11 +13,21 @@ (struct-out quit) (struct-out process) (struct-out transition) - ? ;; imported from route.rkt + + ;; imported from route.rkt: + ? wildcard? + ?! + capture? + sub pub gestalt-union + gestalt-ref + compile-gestalt-projection + gestalt-project + gestalt-project->finite-set + spawn send feedback diff --git a/minimart/gestalt.rkt b/minimart/gestalt.rkt index 5442c22..b473146 100644 --- a/minimart/gestalt.rkt +++ b/minimart/gestalt.rkt @@ -8,12 +8,16 @@ (provide (struct-out gestalt) gestalt-ref + compile-gestalt-projection gestalt-project + gestalt-project->finite-set drop-gestalt lift-gestalt simple-gestalt gestalt-empty gestalt-combine + gestalt-combine-straight + gestalt-combine-crossed gestalt-union gestalt-intersect gestalt-filter @@ -60,9 +64,15 @@ (define p (safe-list-ref v level (lambda () '(#f . #f)))) ((if get-advertisements? cdr car) p)) +(define (compile-gestalt-projection spec) + (compile-projection spec)) + (define (gestalt-project g metalevel level get-advertisements? capture-spec) (matcher-project (gestalt-ref g metalevel level get-advertisements?) capture-spec)) +(define (gestalt-project->finite-set g metalevel level get-advertisements? capture-spec) + (matcher->finite-set (gestalt-project g metalevel level get-advertisements? capture-spec))) + (define (drop-gestalt g) (match-define (gestalt metalevels) g) (if (null? metalevels) g (gestalt (cdr metalevels))))