Re: (warn) isn't doing what I expect it to



Kent M Pitman <pitman@xxxxxxxxxxx> writes:
> Lars Brinkhoff <lars.spam@xxxxxxxxxx> writes:
> > Kent M Pitman <pitman@xxxxxxxxxxx> writes:
> > > Additionally, there were some systems where you pressed Enter (a
> > > key distinct from Return or Linefeed) and this meant not to add
> > > a newline character but to activate immediately, submitting what
> > > had been typed but not any termination key.
> > That's ^D in Unix (except ^D on an empty line will usually be
> > interpreted as EOF).
> And i think some *nix based Lisp systems will close the input stream
> when they see a ^D, which isn't so good if you're doing a REPL on
> that stream.

(This is no longer very Lisp-related, so I'll just write this
additional article.)

They don't see ^D, they see the current input line, without any
terminting character. (If the line is empty, there will be zero
characters, interpreted as EOF.) For example, here's a Lisp session
where I used ^D to enter three input lines:

This is SBCL [...]
* 42
42
* (defun foo () (quit))
FOO
* (foo)[Exit]
.



Relevant Pages

  • Re: (warn) isnt doing what I expect it to
    ... >> And i think some *nix based Lisp systems will close the input stream ... > characters, interpreted as EOF.) ... I _expect_ ^D to be interpreted as an EOF character in any line-based ...
    (comp.lang.lisp)
  • Re: Test Your C Skills - Errors
    ... You would not get a chance to supply a character for second scanf() statement. ... This would flush out the enter hit for the previous scanfto be flushed out from the input stream, ... In the printf statement, %c is used for printing integer i, and %d for character, this causes undefined behaviour. ... Printing a character as an integral type is perfectly valid and defined in the C standard, however it may not yield the same results intended. ...
    (comp.lang.c)
  • Re: read-char vs. read-char-no-hang
    ... input stream or nil if there is none available. ... char does not return when no character is available. ... while READ-CHAR-NO-HANG would return NIL. ...
    (comp.lang.lisp)
  • Re: Whats the guideline for dealing with unwanted chars in input stream?
    ... > When should we worry about the unwanted chars in input stream? ... If you want to read some data character to character, ... Other more complex resources are also available. ...
    (comp.lang.c)
  • Re: How to tell reader that strings are delimited with `< and `> ?
    ... the input stream until the matching> is found. ... reader macro on a temporary local readtable, ... string. ... character as argument. ...
    (comp.lang.lisp)