Rename wrap -> live-wrap and use in websocket server module.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 8 Aug 2017 20:43:14 +0000 (15:43 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 8 Aug 2017 20:43:14 +0000 (15:43 -0500)
* 8sync/actors.scm (live-wrap): Rename from `wrap' for clarity.
(build-actions): Update call to `live-wrap'.
* 8sync/systems/websocket/server.scm (<websocket-server>):
Re-wrap `websocket-client-loop' in `upgrade-paths' slot, now with
`live-wrap'.

8sync/actors.scm
8sync/systems/websocket/server.scm

index 62a07ac113e15d23b87c3cce0e6cf58c2856b8ae..a069a7182a4ae74052a62874cf85266424eec654 100644 (file)
@@ -85,7 +85,7 @@
 
             ;; Maybe the wrong place for this, or for it to be exported.
             ;; But it's used in websockets' server implementation at least...
 
             ;; Maybe the wrong place for this, or for it to be exported.
             ;; But it's used in websockets' server implementation at least...
-            wrap))
+            live-wrap))
 
 ;; For ids
 (set! *random-state* (random-state-from-platform))
 
 ;; For ids
 (set! *random-state* (random-state-from-platform))
            #:message message))
   (apply method actor message (message-body message)))
 
            #:message message))
   (apply method actor message (message-body message)))
 
-(define-syntax-rule (wrap body)
+(define-syntax-rule (live-wrap body)
   "Wrap possibly multi-value function in a procedure, applies all arguments"
   (lambda args
     (apply body args)))
 
 (define-syntax-rule (build-actions (symbol method) ...)
   "Construct an alist of (symbol . method), where the method is wrapped
   "Wrap possibly multi-value function in a procedure, applies all arguments"
   (lambda args
     (apply body args)))
 
 (define-syntax-rule (build-actions (symbol method) ...)
   "Construct an alist of (symbol . method), where the method is wrapped
-with `wrap' to facilitate live hacking and allow the method definition
+with `live-wrap' to facilitate live hacking and allow the method definition
 to come after class definition."
   (build-rmeta-slot
    (list (cons (quote symbol)
 to come after class definition."
   (build-rmeta-slot
    (list (cons (quote symbol)
-               (wrap method)) ...)))
+               (live-wrap method)) ...)))
 
 (define-class <actor> ()
   ;; An address object... a vector of #(actor-id hive-id inbox-channel dead?)
 
 (define-class <actor> ()
   ;; An address object... a vector of #(actor-id hive-id inbox-channel dead?)
index 47510672b4ebcc7ef84266000ff49e25a1bb10f4..7a7526d054f8a4fadb645d6448eedc84d887ccdb 100644 (file)
@@ -68,7 +68,8 @@ string."
 
 (define-actor <websocket-server> (<web-server>)
   ((ws-send websocket-server-send))
 
 (define-actor <websocket-server> (<web-server>)
   ((ws-send websocket-server-send))
-  (upgrade-paths #:init-value `(("websocket" . ,websocket-client-loop))
+  (upgrade-paths #:init-value `(("websocket" .
+                                 ,(live-wrap websocket-client-loop)))
                  #:allocation #:each-subclass
                  #:accessor .upgrade-paths)
 
                  #:allocation #:each-subclass
                  #:accessor .upgrade-paths)