[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read-line
I have had the same problem that Wang describes, and mentioned this months
ago. If READ-LINE is the first read-function encountered in a program it
invariably returns "". Evidently there is a \#Newline left over from having
hit return at top-level. Here's an example:
Starts dribbling to let (1988/7/21, 10:54:53).
NIL
> (setq a (read-line))
""
; I didn't get a chance to type anything
> a
""
> (setq a (read-line) b (read-line))
hi there
"hi there"
> a
""
> b
"hi there"
This is on 4.3 Unix.
The obvious solution is to include a piece of code that checks, at top level,
whether there is in fact a hanging newline and then disposes of if so. But
it's ugly.
-Eliot