Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Last active December 28, 2015 13:29
Show Gist options
  • Save PuercoPop/7508542 to your computer and use it in GitHub Desktop.
Save PuercoPop/7508542 to your computer and use it in GitHub Desktop.
;; This works
(defun read-until (character stream)
"Read the stream until it matches the character. all the characters
read."
(coerce (loop
for char = (read-char stream)
until (char= char character)
until (char= char #\>)
collect char)
'string))
;; But I want read until I reach One of N characters. Lets say > and
;; space, the loop becomes
(loop
for char = (read-char stream)
until (char= char #\Space)
until (char= char #\>)
collect char)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment