src/streams.lisp @ d05f5412e9aa default tip

Update documentation
author Steve Losh <steve@stevelosh.com>
date Tue, 11 Nov 2025 14:34:11 -0500
parents 443af0e76dd6
children (none)
(in-package :losh.streams)

(defmacro with-eof-handled ((stream eof-error-p eof-value) &body body)
  (alexandria:once-only (stream eof-error-p eof-value)
    `(if (null (peek-char nil ,stream nil))
       (if ,eof-error-p
         (error 'end-of-file)
         ,eof-value)
       (progn ,@body))))