[Top][All Lists]

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

Re: [Chicken-users] read-line

From: Anthony Carrico
Subject: Re: [Chicken-users] read-line
Date: Tue, 10 Dec 2002 21:25:27 -0500 (EST)

On 10 Dec 2002, Joerg F. Wittenberger wrote:

> Anybody who objects this change, which understands any of:
>  #\newline #\return
>  #\return #\newline
>  #\newline
>  #\return
> as line delimiter.  Sequences, though, should result in empty lines.

A long time ago I did a lot of work on a common-lisp-to-common-lisp
networking package. This was a real problem. The issue with your solution
is that #\return #\newline pairs can be split across packets, so you may
see a lone #\return and say, "ok that is an apple end of line", but then
if it was actually a microsoft eol split across two packets, the
char-ready? (or equivalent) procedure will indicate a character is ready,
when there really isn't one (the last readline should have sucked it up).
This is an ugly problem. In general, if it is possible, I would say it is
best to specify the eol character according to the protocol, instead of
the OS, and to code the appropriate eol into a custom readline.

  -Tony Carrico

reply via email to

[Prev in Thread] Current Thread [Next in Thread]