actors: debug: Expose more things via debug
authorChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 27 Apr 2016 02:35:10 +0000 (21:35 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 27 Apr 2016 02:35:10 +0000 (21:35 -0500)
* 8sync/systems/actors/debug.scm (expose): New macro for easy exposing
  of things not normally exported from the actors module.
  (hive-resolve-local-actor): Switch to use "expose".
  (actor-hive): Expose/export.
  (hive-create-actor-gimmie*): Switch to be a procedure rather than a macro.

8sync/systems/actors/debug.scm

index 61baf0c5c275ab752a8720653c3069fe700cefa0..0a5615d0f2fad9c72f08e8b375e3fef6707774b6 100644 (file)
   #:use-module (oop goops)
   #:use-module (8sync systems actors)
   #:export (hive-resolve-local-actor
-            hive-create-actor-gimmie))
+            actor-hive
 
-(define hive-resolve-local-actor
-  (@@ (8sync systems actors) hive-resolve-local-actor))
+            hive-create-actor-gimmie
+            hive-create-actor-gimmie*))
+
+\f
+;;; Expose not normally exposed methods
+;;; ===================================
+
+;; "private" kind of a misnomer
+(define-syntax-rule (expose private-var)
+  (define private-var
+    (@@ (8sync systems actors) private-var)))
+
+(expose hive-resolve-local-actor)
+(expose actor-hive)
+
+
+\f
+;;; Some utilities
+;;; =============
 
 (define (hive-create-actor-gimmie . args)
   "Create an actor on the hive, and give us that actor.
@@ -31,8 +48,10 @@ Uses hive-create-actor* arguments."
   (let ((actor-id (apply hive-create-actor args)))
     (hive-resolve-local-actor hive actor-id)))
 
-(define-syntax-rule (hive-create-actor-gimmie* args ...)
+(define (hive-create-actor-gimmie* . args)
   "Create an actor on the hive, and give us that actor.
 Uses hive-create-actor* arguments."
-  (let ((actor-id (hive-create-actor* args ...)))
+  (let ((actor-id (apply hive-create-actor* args)))
     (hive-resolve-local-actor hive actor-id)))
+
+