(let ((id (address-id address)))
(let ((behaviour (hash-table-ref/default actor-table id '())))
(if (null? behaviour)
- (print "Warning: discarded message " message
+ (print "## Warning: discarded message " message
" to unknown actor id " id)
- (match (apply (hash-table-ref actor-table id) (cons address message))
- ('done (hash-table-delete! actor-table id))
- ('sleep 'do-nothing)
- (new-beh (hash-table-set! actor-table id new-beh)))))))
+ (condition-case
+ (match (apply behaviour (cons address message))
+ ('done (hash-table-delete! actor-table id))
+ ('sleep 'do-nothing)
+ (new-beh (hash-table-set! actor-table id new-beh)))
+ ((exn)
+ (print "## Warning: actor id " id " crashed evaluating message " message)))))))
;; Scheduler