actors: Remove unnecessary let in hive-process-message.
[8sync.git] / 8sync / systems / actors.scm
index 9009d301470a1c9872fd32cfe306b5f1b1b1653d..e33a88b3658eb514da2dd21b04d85e1f6305f322 100644 (file)
@@ -71,6 +71,8 @@
             send-message send-message-wait
             reply-message reply-message-wait
 
+            <- <-wait <-reply <-reply-wait
+
             ez-run-hive
             bootstrap-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)))