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



Nathan Baum <nathan_baum@xxxxxxxxxxxxxx> writes:
> In the real code, the newline is provided elsewhere. It turned out
> that way because CLISP doesn't put a newline after a warning:
>
> (progn (warn "foo")
> (princ "bar"))
>
> I don't feel the need to change things, since putting a newline in
> there messes up the display, and removing it from where it is
> displayed at the moment means that normal Lisp warnings (which I'm not
> yet redirecting to a log) will be messed up when using CLISP.

The point is that lisp is old enough to be born at a time when
newlines were inserted _before_ the lines. You needed to move to a
new-line to be able to print the current line or punch the current
card.

Note that even on a video terminal, it might be useful to use the
newline before convention, since it gives you one more line on the
screen. With the newline after, you always get the last like blank
(not that matter much in a 80x60 emacs window ;-).

If you want to follow unix convention, you need to make intensive use
of ~&: (format t "~&bar~%") instead of (princ "bar") to interact
nicely with "older" lisp code.

--
"Specifications are for the weak and timid!"
.



Relevant Pages

  • Re: (warn) isnt doing what I expect it to
    ... the newline is provided elsewhere. ... >> displayed at the moment means that normal Lisp warnings (which I'm not ... >> yet redirecting to a log) will be messed up when using CLISP. ... So, for portability, since some command processors took ...
    (comp.lang.lisp)
  • Re: How to convert Infix notation to postfix notation
    ... using a Microsoft compiler. ... nilges.c: error C2001: newline in constant ... nilges.c: warning C4127: conditional expression is constant ...
    (comp.lang.c)
  • VC++ .NET
    ... the include and lib dirs also the headers. ... warning C4067: unexpected tokens following preprocessor directive - expected a newline ...
    (comp.graphics.api.opengl)
  • Re: warning: no newline at end of file
    ... # I enable All Warnings during compiling my programs. ... # What is the significance of this warning: ... # I use gcc to compile, but wonder why it needs a newline at end of the ... Raining down sulphur is like an endurance trial, ...
    (comp.lang.c)
  • Re: The sizeof operator : sizeof(++i)
    ... warning: incompatible implicit declaration of built-in function printf ... no newline after output - text may not appear onscreen ... (and on Linux, it doesn't...) ...
    (comp.lang.c)