X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=sam.git;a=blobdiff_plain;f=sam-macros.scm;h=bbf8adab5cb26acaedba85164ece96fddf7f0d9c;hp=16faba3f0ccf7e13f1cccad7dc2c39a0fb8d8608;hb=HEAD;hpb=db875d2441ba67f863dc6e848d609f67d42eacf5 diff --git a/sam-macros.scm b/sam-macros.scm index 16faba3..bbf8ada 100644 --- a/sam-macros.scm +++ b/sam-macros.scm @@ -1,8 +1,7 @@ ;; Macro definitions used for SAM behaviour definition ;; -(module sam-macros - (make-beh define-beh) +(module sam-macros * (import scheme (chicken base) @@ -11,7 +10,8 @@ (define-syntax make-beh (syntax-rules (: => finally) ((make-beh : parent (self) (pat => body ...) ... (finally after ...)) - (cons (lambda (self . message) + (list 'beh + (lambda (self . message) (match message (pat body ...) ... @@ -28,5 +28,18 @@ (define-syntax define-beh (syntax-rules () ((_ name rest ...) - (define name (make-beh rest ...)))))) + (define name (make-beh rest ...))))) + + (define-syntax make-actor-with-beh + (syntax-rules () + ((_ rest ...) + (make-actor + (make-beh rest ...))))) + + (define-syntax define-actor-with-beh + (syntax-rules () + ((_ name rest ...) + (define name + (make-actor-with-beh rest ...)))))) +