X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=sam.git;a=blobdiff_plain;f=sam.scm;h=c40116dd7258527eab4dcd232c958d89d1c01983;hp=a8ea67b9e1afb37cb001197f8794865f2bb93d01;hb=7b73d44a72ed33304da016672c8f243a585856fa;hpb=98614aaf3ed99a4945600eadd08de9abaeade6be diff --git a/sam.scm b/sam.scm index a8ea67b..c40116d 100644 --- a/sam.scm +++ b/sam.scm @@ -58,8 +58,7 @@ (define root-beh (make-beh : #f (self) (('ping recipient) => - (send-message recipient 'pong) - 'sleep))) + (send-message recipient 'pong)))) ;; Actors @@ -111,13 +110,12 @@ (condition-case (match (apply (beh-proc beh) (cons address message)) ('done (hash-table-delete! actor-table id)) - ('sleep 'do-nothing) ('pass (log-trace "Passing to parent behaviour...") (loop (beh-parent beh))) ((? procedure? new-beh) (hash-table-set! actor-table id new-beh)) (else - (log-msg "Warning: behaviour of actor " id " returned invalid value."))) + 'do-nothing)) ; sleep is now the default (o (exn) (log-msg "Warning: actor " id " crashed evaluating message " (->stringrep message)) (print-error-message o))) @@ -230,15 +228,13 @@ 'done) (('print strings ...) => - (apply print strings) - 'sleep) + (apply print strings)) (('read reader) => (mutex-lock! reader-queue-mutex) (fifo-push reader-queue reader) (mutex-unlock! reader-available-mutex) - (mutex-unlock! reader-queue-mutex) - 'sleep)) + (mutex-unlock! reader-queue-mutex))) (define (boot-sam) (start-console)