diff --git a/code/read.lisp b/code/read.lisp index 42d913f..27d9301 100644 --- a/code/read.lisp +++ b/code/read.lisp @@ -127,12 +127,12 @@ ;; the cache residue and cache suffix that are now before ;; the current stream position. unless (eq kind :whitespace) - do (loop for residue = (residue cache) - while (and (not (null residue)) - (position< (first residue) analyzer)) - do (pop-from-residue cache)) - (when (null (residue cache)) - (loop for suffix = (suffix cache) - while (and (not (null suffix)) - (position< (first suffix) analyzer)) - do (pop-from-suffix cache)))))) + do (macrolet ((clear (reader popper) + `(loop :for remaining = (,reader cache) + :while (and (not (null remaining)) + (position< (first remaining) + analyzer)) + :do (,popper cache)))) + (clear residue pop-from-residue) + (when (null (residue cache)) + (clear suffix pop-from-suffix))))))