- ((pester-rep actor message)
- (~display "customer> I'm calling customer service about this!\n")
- (let ((reply (<-wait actor (message-ref message 'who-to-call)
- 'field-call)))
- (if (message-ref reply '*auto-reply* #f)
- (~display "customer> Whaaaaat? I can't believe I got voice mail!\n")
- (begin
- (~format "*customer hears*: ~a\n" (message-ref reply 'msg))
- (let ((reply (<-reply-wait
- actor reply
- #:msg "Yes, it didn't work, I'm VERY ANGRY!")))
- (if (message-ref reply '*auto-reply* #f)
- (~display "customer> Well then! Harumph.\n")
- (error "Not an autoreply? What's going on here..."))))))))
+ (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")
+ (msg-receive (first-reply #:key msg)
+ (<-wait actor who-to-call 'field-call)
+ (if (message-auto-reply? first-reply)
+ (~display "customer> Whaaaaat? I can't believe I got voice mail!\n")
+ (begin
+ (~format "*customer hears*: ~a\n" msg)
+ (msg-receive (second-reply #:key *auto-reply*)
+ (<-reply-wait actor first-reply
+ #:msg "Yes, it didn't work, I'm VERY ANGRY!")
+ (if (message-auto-reply? second-reply)
+ (~display "customer> Well then! Harumph.\n")
+ (error "Not an autoreply? What's going on here...")))))))