Sleep is now the default actor behaviour.
[sam.git] / sam.scm
diff --git a/sam.scm b/sam.scm
index a8ea67b..c40116d 100644 (file)
--- 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
 
           (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)))
    '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)