summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoutade <thegoofist@protonmail.com>2019-05-03 13:44:26 -0500
committerBoutade <thegoofist@protonmail.com>2019-05-03 13:44:26 -0500
commit5b67df51896d7215d5ca1d10e0c0f8e02e81a61f (patch)
tree61f3816cf0c13d378c092d7c905448b969e2a98c
parent3dce8bff916b2b938861fc1d853fedeeaf7baf6b (diff)
this version works, but log disposal is turned off
-rw-r--r--replay-streams.lisp10
1 files changed, 7 insertions, 3 deletions
diff --git a/replay-streams.lisp b/replay-streams.lisp
index f0b1a41..ad41a79 100644
--- a/replay-streams.lisp
+++ b/replay-streams.lisp
@@ -58,6 +58,7 @@
(cond
;; if the head is less than source-head, then we're reading from the log
((< head source-head)
+ (format t "< head source-head~%")
(incf head) ;; order matters, we use the incremented value next
(aref log (- head log-start 1)))
@@ -65,6 +66,7 @@
((and (= head source-head)
(null log)
(null checkpoints))
+ (format t "= head source-head, normal read~%")
(if (peek-char nil source nil nil)
(progn
(incf head)
@@ -75,6 +77,7 @@
;; otherwise we're reading from the stream but we may be logging our reads
;; so if we're not at the end of the input, we've got some stuff to do
((and (= head source-head) (peek-char nil source nil nil))
+ (format t "head = source-head, maybe logged read~%")
(let ((char (read-char source)))
(incf head)
(incf source-head)
@@ -150,10 +153,11 @@
(with-slots (head checkpoints source-head) stream
(setf head point)
;; reqinding to a point clobbers all "future" checkpoints
- (setf checkpoints (remove-if (lambda (pt) (>= pt head)) checkpoints))
+ ;(setf checkpoints (remove-if (lambda (pt) (>= pt head)) checkpoints))
t))
(defmethod free-checkpoint ((stream character-input-replay-stream) point)
- (with-slots (checkpoints) stream
- (setf checkpoints (remove-if (lambda (pt) (>= pt point)) checkpoints)))
+ ;(with-slots (checkpoints) stream
+ ;(setf checkpoints (remove point checkpoints :count 1))
+ ;(setf checkpoints (remove-if (lambda (pt) (>= pt point)) checkpoints)))
t)