Re: newline conventions
- From: Sam Steingold <sds@xxxxxxx>
- Date: Tue, 30 Aug 2005 09:15:44 -0400
> * Kent M Pitman <cvgzna@xxxxxxxxxxx> [2005-08-30 12:52:43 +0000]:
>
> Many people like me who come from LispM days always protect our
> output by doing
> (format t "~&...~%")
> to say "make sure the previous I/O cleaned up, and make sure we don't
> leave ourselves mid-line either."
CLISP offers "elastic newline":
<http://clisp.cons.org/impnotes/stream-dict.html#elastic-newline>:
The function (EXT:ELASTIC-NEWLINE [stream]) is like FRESH-LINE but the
other way around: It outputs a conditional newline on stream, which is
canceled if the next output on stream happens to be a newline. More
precisely, (EXT:ELASTIC-NEWLINE [stream]) causes a newline to be output
right before the next character is written on stream, if this character
is not a newline. The newline is also output if the next operation on
the stream is FRESH-LINE, FINISH-OUTPUT, FORCE-OUTPUT or CLOSE.
The functionality of EXT:ELASTIC-NEWLINE is also available through the
FORMAT directive ~..
A technique for avoiding unnecessary blank lines in output is to begin
each chunk of output with a call to FRESH-LINE and to terminate it with
a call to EXT:ELASTIC-NEWLINE.
See
<http://cvs.sourceforge.net/viewcvs.py/*checkout*/clisp/clisp/doc/Newline-Convention.txt>
for rationale.
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.palestinefacts.org/> <http://truepeace.org> <http://www.memri.org/>
<http://ffii.org/> <http://www.dhimmi.com/> <http://www.savegushkatif.org>
If it has syntax, it isn't user friendly.
.
- References:
- (warn) isn't doing what I expect it to
- From: Nathan Baum
- Re: (warn) isn't doing what I expect it to
- From: Nathan Baum
- Re: (warn) isn't doing what I expect it to
- From: Edi Weitz
- Re: (warn) isn't doing what I expect it to
- From: Nathan Baum
- Re: (warn) isn't doing what I expect it to
- From: Kent M Pitman
- Re: (warn) isn't doing what I expect it to
- From: Nathan Baum
- Re: (warn) isn't doing what I expect it to
- From: Pascal Bourguignon
- Re: (warn) isn't doing what I expect it to
- From: Kent M Pitman
- (warn) isn't doing what I expect it to
- Prev by Date: Re: Concentration in OCaml
- Next by Date: Re: (warn) isn't doing what I expect it to
- Previous by thread: Re: (warn) isn't doing what I expect it to
- Next by thread: Re: (warn) isn't doing what I expect it to
- Index(es):
Relevant Pages
|