(format t "This is just ~
one line.~%")
should return?
--d
NIL
-dan
--
http://ww.telent.net/cliki/ - Link farm for free CL-on-Unix resources
Right; I'd like to get a feel for what people generally
expect this call to print. Ie, its side-effect.
I myself would expect it to print the immediately
following not-completely-whitespace line.
This is just one line.
It doesn't though, and I wonder if other people
find that not quite right.
--d
There's a space between the tilde and the newline. I don't think ~<space>
is defined as a standard format control, so the consequences are
undefined. Are you under the impression that ~<space><newline> should be
treated the same as ~<newline>?
--
Barry Margolin, bar...@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
Wouldn't that be "nice" though? It is disconcerting,
to me at least, that invisible trailing space,
should so drastically affect a program's behavior.
(Something even Python doesn't dare allow. :-)
One might counter that invisible trailing space in
calls like
(princ "abc
def")
does change meaning, but all that does is faithfully
reproduce invisible trailing space when given
invisible trailing space, ie, the effect isn't as
drastic.
--d
What do you mean with "it doesn't though"?
It must print "This is just one line<end-of-line>",
If the implementation you are using behaves
differently, it must have a bug.
Or, do you mean that there is an ambiguity
in the spec? Where exactly?
P.
It should not return, it should signal an error because the final space
is not defined as a format control. This is no different from
(format t "This is just ~ one line.~%")
Trailing whitespace within strings is not invisible to the Lisp reader.
///
--
In a fight against something, the fight has value, victory has none.
In a fight for something, the fight is a loss, victory merely relief.
Every language I know that uses backslash ( \ ) to do line
continuation will do "something disconcerting" (i.e. not continue the
line) if a space (or anything else) follows the backslash. It has
little to do with daring. :) Similarly, Unix's make program demands
leading tabs.
Whitespace, and sometimes different *kinds* of whitespace, matters --
as you now know. :)
I find it useful to go through my code every so often and look for
whitespace at the end of lines. I don't think it's caused me any
trouble yet, but only because I eliminate it whenever I find it. :)
-- L