[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Does READ-CHAR echo?



    Date: Fri, 26 Jul 85 15:02 EDT
    From: Kent M Pitman <KMP@SCRC-STONY-BROOK.ARPA>

    I could not find any place in CLtL where it says whether READ-CHAR echos
    the character that it has read. Likewise for PEEK-CHAR. Also, there is
    no discussion of whether UNREAD-CHAR should unecho the character.

    I note that Symbolics Common Lisp has (somewhat arbitrarily, I guess)
    decided that READ-CHAR echos, PEEK-CHAR does not echo, and UNREAD-CHAR
    does not un-echo the character. This has the odd effect that:
 
     (PROGN (PEEK-CHAR) (UNREAD-CHAR (READ-CHAR)) (READ-CHAR))

    echos the character twice. I imagine it will be a real hassle when programs
    start porting if this behavior does not become standardized.

I would suggest that it is incorrect for READ-CHAR to echo a character
which was UNREAD-CHAR'd.  Such a character has already been echoed once.
I think this is just a bug.

    Does anyone have any thoughts about whether we should think about adding
    functions called PEEK-CHAR-NO-ECHO, READ-CHAR-NO-ECHO, and UNREAD-CHAR-NO-ECHO?
    Or maybe there should be WITH-INPUT-ECHO and WITHOUT-INPUT-ECHO special forms
    which affect calls to the character readers within the dynamic scope of their
    body.
I think the only one needed would be READ-CHAR-NO-ECHO.