Thank you for the quick reply! That solves my problem.
Actually, your reply led me to read the spec more carefully, and I
realized that since I'm calling read recursively, I should probably
use recursive-p = t, thus:
(defun sharp-bang-read (stream char n)
(declare (ignore char n))
(read stream t nil t)
(read stream t nil t))
That solves the problem, too; I'll probably go with this unless I hear
that it's not a good idea.
Regards, and thanks again,
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
Date: Wed, 19 Oct 2011 01:39:19 +0200
From: Stig Hemmer <stighemmer@...>
Content-Type: text/plain; charset=ISO-8859-1
The problem is that the last (READ STREAM) reads the following newline
and discards it. The REPL then needs another newline to end the line.
This is in fact according to spec, here is what the description of READ says:
When *read-suppress* is false, read throws away the delimiting
character required by certain printed representations if it is a
whitespace character; but read preserves the character (using
unread-char) if it is syntactically meaningful, because it could be
the start of the next expression.
You can use READ-PRESERVING-WHITESPACE instead to get the effect you want.