actors: Remove unnecessary let in hive-process-message.
[8sync.git] / 8sync / systems / actors.scm
index 7e8d9576033587cff78537d956964cf2ff7e48bb..e33a88b3658eb514da2dd21b04d85e1f6305f322 100644 (file)
             send-message send-message-wait
             reply-message reply-message-wait
 
+            <- <-wait <-reply <-reply-wait
+
             ez-run-hive
-            hive-bootstrap-message
+            bootstrap-message
 
             serialize-message write-message
             serialize-message-pretty pprint-message
@@ -246,6 +248,16 @@ If key not found and DFLT not provided, throw an error."
     (abort-to-prompt abort-to from-actor new-message)))
 
 
+;;; Aliases!
+;;; See: http://mumble.net/~jar/articles/oo-moon-weinreb.html
+;;;   (also worth seeing: http://mumble.net/~jar/articles/oo.html )
+
+(define <- send-message)
+(define <-wait send-message-wait)
+(define <-reply reply-message)
+(define <-reply-wait reply-message-wait)
+
+
 \f
 ;;; Main actor implementation
 ;;; =========================
@@ -472,13 +484,12 @@ more compact following syntax:
     (call-with-prompt (hive-prompt hive)
       thunk
       (lambda (kont actor message)
-        (let ((hive (actor-hive actor)))
-          ;; Register the coroutine
-          (hash-set! (hive-waiting-coroutines hive)
-                     (message-id message)
-                     (cons (actor-id actor) kont))
-          ;; Send off the message
-          (8sync (hive-process-message hive message))))))
+        ;; Register the coroutine
+        (hash-set! (hive-waiting-coroutines hive)
+                   (message-id message)
+                   (cons (actor-id actor) kont))
+        ;; Send off the message
+        (8sync (hive-process-message hive message)))))
 
   (define (process-local-message)
     (let ((actor (resolve-actor-to)))
@@ -620,7 +631,7 @@ an integer."
       (spawn-and-queue-repl-server! agenda)))
     (start-agenda agenda)))
 
-(define (hive-bootstrap-message hive to-id action . message-body-args)
+(define (bootstrap-message hive to-id action . message-body-args)
   (wrap
    (apply send-message hive to-id action message-body-args)))