[Openmcl-devel] peek-char, interpretation of first argument
Stas Boukarev
stassats at gmail.com
Thu Feb 13 22:16:05 PST 2014
Erik Pearson <erik at adaptations.com> writes:
> I'm doing some gray streams programming and came across a weird little
> corner case. In ccl, when I call peek-char with just the gray stream (it is
> a string-based stream), ccl hangs. Other lisps (clisp, sbcl) throw an
> exception, complaining that the peek-type is not an expected type (one of
> the types defined for peek-type - null, t, character)
>
> However, CLHS says:
>
> If peek-type is not supplied or nil, peek-char returns the next character
> to be read from input-stream
>
> http://clhs.lisp.se/Body/f_peek_c.htm
>
> So ... wouldn't one expect that (peek-char stream) would behave like
> (peek-char nil stream)?
No, there's absolutely no reason to expect such behaviour, and I'm not
quite sure how you could come to such a conclusion from reading that
paragraph from CLHS.
--
With best regards, Stas.
More information about the Openmcl-devel
mailing list