guix: Use guile-3.0.
[8sync.git] / 8sync / agenda.scm
index 3aa43da1eeec85dee0f6d9f9d58abe1d6084b558..e91487eda3aa52cbef2513eaa57ff91e094e89b1 100644 (file)
@@ -1,5 +1,5 @@
 ;;; 8sync --- Asynchronous programming for Guile
-;;; Copyright (C) 2015, 2016 Christopher Allan Webber <cwebber@dustycloud.org>
+;;; Copyright © 2015, 2016, 2017 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of 8sync.
 ;;;
@@ -62,7 +62,7 @@
             stop-on-nothing-to-do
 
             %current-agenda-prompt
-            start-agenda agenda-run-once!))
+            run-agenda agenda-run-once!))
 
 \f
 ;;; Agenda definition
@@ -411,7 +411,8 @@ forge ahead in our current function!"
     ;; convert into sec / usec pair
     (receive (secs usecs)
         (floor/ next-time-in-usecs 1000000)
-      (cons secs (floor usecs))))
+      (cons (inexact->exact secs)
+            (inexact->exact (floor usecs)))))
   (define (convert-integer)
     (cons (+ in-secs cur-secs) cur-usecs))
   (if (integer? in-secs)
@@ -553,16 +554,14 @@ on suspendable ports."
        (= 0 (hash-count (const #t) (agenda-write-port-map agenda)))))
 
 
-(define* (start-agenda agenda
-                       #:key (stop-condition stop-on-nothing-to-do)
-                       ;; For live hacking madness, etc
-                       (post-run-hook #f))
+(define* (run-agenda agenda
+                     #:key (stop-condition stop-on-nothing-to-do)
+                     ;; For live hacking madness, etc
+                     (post-run-hook #f))
   ;; TODO: Document fields
   "Start up the AGENDA"
   (install-suspendable-ports!)
   (parameterize ((%current-agenda-prompt (agenda-prompt-tag agenda))
-                 ;; @@: Couldn't we just parameterize this at the start of
-                 ;;   the agenda...?
                  (current-read-waiter wait-for-readable)
                  (current-write-waiter wait-for-writable))
     (while (not (stop-condition agenda))