X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=tests%2Ftest-actors.scm;h=30f13d053f847d18de56abfa00ad2eb92cf2c8d4;hp=4d7ec4b3d1a2fc6f99cedfbdcb1d82e594cce960;hb=8bdfa5c8f81d4e46d57c367da23cd8ea676ad717;hpb=2785c244a09fc008488385b10053ef854fb27c34 diff --git a/tests/test-actors.scm b/tests/test-actors.scm index 4d7ec4b..30f13d0 100644 --- a/tests/test-actors.scm +++ b/tests/test-actors.scm @@ -74,8 +74,8 @@ ;;; Test reply / autoreply ;;; ====================== -(define-simple-actor - (pester-rep (wrap-apply antsy-caller-pester-rep))) +(define-actor () + ((pester-rep (wrap-apply antsy-caller-pester-rep)))) (define* (antsy-caller-pester-rep actor message #:key who-to-call) (~display "customer> I'm calling customer service about this!\n") @@ -92,8 +92,8 @@ (~display "customer> Well then! Harumph.\n") (error "Not an autoreply? What's going on here..."))))))) -(define-simple-actor - (field-call (wrap-apply rep-field-call))) +(define-actor () + ((field-call (wrap-apply rep-field-call)))) (define (rep-field-call actor message) (~display "good-rep> Hm, another call from a customer...\n") @@ -102,10 +102,10 @@ (~format "*rep hears*: ~a\n" msg) (~display "good-rep> I'm sorry, that's all I can do for you.\n"))) -(define-simple-actor - (field-call - (lambda (actor message) - (~display "lazy-rep> I'm not answering that.\n")))) +(define-actor () + ((field-call + (lambda (actor message) + (~display "lazy-rep> I'm not answering that.\n"))))) (let* ((hive (make-hive)) (customer (bootstrap-actor* hive "antsy-caller")) @@ -140,8 +140,8 @@ customer> Whaaaaat? I can't believe I got voice mail!\n" ;;; Cleanup tests -(define-simple-actor - (*cleanup* test-call-cleanup)) +(define-actor () + ((*cleanup* test-call-cleanup))) (define (test-call-cleanup actor message) (speak "Hey, I'm cleanin' up here!\n")) @@ -165,11 +165,11 @@ customer> Whaaaaat? I can't believe I got voice mail!\n" ;; The exploder self-destructs, even though run-hive has cleanup ;; disabled, because it cleans up on self-destruct. -(define-simple-actor - (explode (lambda (exploder message) - (speak "POOF\n") - (self-destruct exploder))) - (*cleanup* (lambda _ (speak "Cleaning up post-explosion\n")))) +(define-actor () + ((explode (lambda (exploder message) + (speak "POOF\n") + (self-destruct exploder))) + (*cleanup* (lambda _ (speak "Cleaning up post-explosion\n"))))) (with-fresh-speaker (let ((hive (make-hive))) @@ -184,7 +184,7 @@ customer> Whaaaaat? I can't believe I got voice mail!\n" (create-friend #:init-value #f #:init-keyword #:create-friend) (actions #:allocation #:each-subclass - #:init-value (build-actions + #:init-thunk (build-actions (*init* hi-on-init-init)))) (define (hi-on-init-init actor message)