- (message-handler
- #:init-value
- (make-action-dispatch
- (bother-professor
- (lambda (actor message)
- "Go bother a professor"
- (while (not (student-dead actor))
- (format #t "~a: Bother bother bother!\n"
- (actor-id-actor actor))
- (send-message
- actor (message-ref message 'target)
- 'be-bothered
- #:noise "Bother bother bother!\n"))))
-
- (be-lambda-consvardraed
- (lambda (actor message)
- "This kills the student."
- (format #t "~a says: AAAAAAAHHHH!!! I'm dead!\n"
- (actor-id-actor actor))
- (set! (student-dead actor) #t))))))
+ (actions #:allocation #:each-subclass
+ #:init-value
+ (build-actions
+ (bother-professor
+ (lambda* (actor message #:key target)
+ "Go bother a professor"
+ (while (not (student-dead actor))
+ (format #t "~a: Bother bother bother!\n"
+ (actor-id-actor actor))
+ (<- actor target
+ 'be-bothered
+ #:noise "Bother bother bother!\n"))))
+
+ (be-lambda-consvardraed
+ (lambda (actor message)
+ "This kills the student."
+ (format #t "~a says: AAAAAAAHHHH!!! I'm dead!\n"
+ (actor-id-actor actor))
+ (set! (student-dead actor) #t))))))