projects
/
8sync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3d3254b
)
agenda now actually runs (but doesn't do anything useful...)
author
Christopher Allan Webber
<cwebber@dustycloud.org>
Tue, 17 Nov 2015 22:53:25 +0000
(16:53 -0600)
committer
Christopher Allan Webber
<cwebber@dustycloud.org>
Tue, 17 Nov 2015 22:53:25 +0000
(16:53 -0600)
loopy.scm
patch
|
blob
|
history
diff --git
a/loopy.scm
b/loopy.scm
index 3db157d4cf3f05ca18e8a06135d96a9dd97c04a1..0f6edc569d5f3a02768096ab05c666816815d4d2 100644
(file)
--- a/
loopy.scm
+++ b/
loopy.scm
@@
-7,18
+7,20
@@
;; replace this
(define-immutable-record-type <agenda>
;; replace this
(define-immutable-record-type <agenda>
- (make-agenda queue)
+ (make-agenda
-intern
queue)
agenda?
(queue agenda-queue))
agenda?
(queue agenda-queue))
-(define %current-agenda
- (make-parameter (make-agenda (make-q))))
+(define* (make-agenda #:key (queue (make-q)))
+ (make-agenda-intern queue))
+
+(define %current-agenda (make-parameter #f))
(define* (start-agenda agenda #:optional stop-condition)
(let loop ((agenda agenda))
(let ((new-agenda
(define* (start-agenda agenda #:optional stop-condition)
(let loop ((agenda agenda))
(let ((new-agenda
- (
agenda-run-once agenda)
))
-
(%current-agenda new-agenda
)
+ (
parameterize ((%current-agenda agenda
))
+
(agenda-run-once agenda)))
)
(if (and stop-condition (stop-condition))
'done
(loop new-agenda)))))
(if (and stop-condition (stop-condition))
'done
(loop new-agenda)))))
@@
-38,11
+40,11
@@
based on the results"
(match proc-result
((? procedure? new-proc)
(enqueue new-proc))
(match proc-result
((? procedure? new-proc)
(enqueue new-proc))
- (((? procedure? new-procs) ..)
+ (((? procedure? new-procs) ..
.
)
(for-each
(lambda (new-proc)
(enqueue new-proc))
(for-each
(lambda (new-proc)
(enqueue new-proc))
- new-procs)))
-
;; TODO: Selecting on ports would happen here?
-
;; Return new agenda, with next queue set
-
(set-field agenda (agenda-queue) next-queue))
)))
+ new-procs)))
))
+ ;; TODO: Selecting on ports would happen here?
+ ;; Return new agenda, with next queue set
+
(set-field agenda (agenda-queue) next-queue
)))