Slightly better style
[8sync.git] / loopy.scm
index 6f1516fdb51449be60c4c952b2d024b97369e968..5c1455ecc86cc8f0f5eeed9b6f21da86d8a98a32 100644 (file)
--- a/loopy.scm
+++ b/loopy.scm
              (agenda-run-once agenda))))
       (if (and stop-condition (stop-condition agenda))
           'done
-          (loop
-           ;; Adjust the agenda's time just in time
-           ;; We do this here rather than in agenda-run-once to make
-           ;; agenda-run-once's behavior fairly predictable
-           (set-field new-agenda (agenda-time) (gettimeofday)))))))
+          (let ((updated-agenda
+                 ;; Adjust the agenda's time just in time
+                 ;; We do this here rather than in agenda-run-once to make
+                 ;; agenda-run-once's behavior fairly predictable
+                 (set-field new-agenda (agenda-time) (gettimeofday))))
+            (loop updated-agenda))))))
 
 (define (agenda-run-once agenda)
   "Run once through the agenda, and produce a new agenda