X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=8sync%2Fsystems%2Factors.scm;h=ce23bfab2acdc16daecfded2456cb66ee47f3bb2;hp=52b18779a11d6d1bd12ba2559dfe804f892de933;hb=47dbaac681252f3d71e78a712cab0c829b913a63;hpb=0e4825bbf6409fb438c9dd69f0d4857b9e22222a diff --git a/8sync/systems/actors.scm b/8sync/systems/actors.scm index 52b1877..ce23bfa 100644 --- a/8sync/systems/actors.scm +++ b/8sync/systems/actors.scm @@ -53,6 +53,8 @@ simple-dispatcher build-actions make-action-dispatch define-simple-actor + mhandlers + make-hive ;; There are more methods for the hive, but there's @@ -323,6 +325,8 @@ ;;; Actor utilities ;;; =============== +;;;;;;;;;;; Deprecated abstractions start here ;;;;;;;;;;; + (define (simple-dispatcher action-map) (lambda (actor message) (let* ((action (message-action message)) @@ -375,11 +379,21 @@ more compact following syntax: ((make-action-dispatch action-item ...) (simple-dispatcher (build-actions action-item ...))))) -(define-syntax-rule (define-simple-actor class actions ...) +;;;;;;;;;;; Deprecated abstractions end here ;;;;;;;;;;; + + +(define-syntax-rule (mhandlers (symbol method) ...) + "Construct an alist of (symbol . method), where the method is wrapped +with wrap-apply to facilitate live hacking and allow the method definition +to come after class definition." + (list + (cons (quote symbol) + (wrap-apply method)) ...)) + +(define-syntax-rule (define-simple-actor class action ...) (define-class class () - (message-handler - #:init-value (make-action-dispatch actions ...) - #:allocation #:each-subclass))) + (actions #:init-value (mhandlers action ...) + #:allocation #:each-subclass))) ;;; The Hive