make the agenda use the run-request
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 19 Nov 2015 19:28:30 +0000 (13:28 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 19 Nov 2015 19:28:30 +0000 (13:28 -0600)
loopy.scm

index b93a1debbfab0bc6701c3b536394f3442c353c30..f11b6b8503b2d235c00544b31956052ff718c28e 100644 (file)
--- a/loopy.scm
+++ b/loopy.scm
@@ -309,15 +309,19 @@ based on the results"
       (let* ((proc (q-pop! queue))
              (proc-result (call-proc proc))
              (enqueue
-              (lambda (new-proc)
-                (enq! next-queue new-proc))))
+              (lambda (run-request)
+                (cond
+                 ((run-request-when run-request)
+                  (error "TODO"))
+                 (else
+                  (enq! next-queue (run-request-proc run-request)))))))
         ;; @@: We might support delay-wrapped procedures here
         (match proc-result
           ;; TODO: replace procedure with something that indicates
           ;;   intent to run.  Use a (run foo) procedure
-          ((? procedure? new-proc)
+          ((? run-request? new-proc)
            (enqueue new-proc))
-          (((? procedure? new-procs) ...)
+          (((? run-request? new-procs) ...)
            (for-each
             (lambda (new-proc)
               (enqueue new-proc))