Skip to content

Commit

Permalink
Add local CLEAR macro in READ-FORMS
Browse files Browse the repository at this point in the history
  • Loading branch information
scymtym committed Jul 25, 2024
1 parent a69e6a9 commit af8aac5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions code/read.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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))))))

0 comments on commit af8aac5

Please sign in to comment.