(or (char= ch #\space) (char= ch #\newline) (char= ch #\tab)))
(defun skip-whitespaces (stream)
- (loop for ch = (%peek-char stream)
- while (and ch (whitespacep ch))
- do (%read-char stream)))
+ (let (ch)
+ (setq ch (%peek-char stream))
+ (while (and ch (whitespacep ch))
+ (%read-char stream)
+ (setq ch (%peek-char stream)))))
(defun terminalp (ch)
(or (null ch) (whitespacep ch) (char= #\) ch)))
(defun read-until (stream func)
- (let ((string ""))
- (loop for ch = (%peek-char stream)
- until (funcall func ch)
- do (setq string (concat string (string ch)))
- do (%read-char stream))
+ (let ((string "")
+ (ch))
+ (setq ch (%peek-char stream))
+ (while (not (funcall func ch))
+ (setq string (concat string (string ch)))
+ (%read-char stream)
+ (setq ch (%peek-char stream)))
string))
(defun skip-whitespaces-and-comments (stream)