Subject: Re: STRING=
From: rpw3@rpw3.org (Rob Warnock)
Date: Sun, 15 Jun 2003 05:54:40 -0500
Newsgroups: comp.lang.lisp
Message-ID: <zfycnccXwOjtzXGjXTWc-w@speakeasy.net>
Kent M Pitman  <pitman@world.std.com> wrote:
+---------------
| And 1.4.1.5 Designators
| http://www.lispworks.com/reference/HyperSpec/Body/01_dae.htm
+---------------

This brings up something that I've always wondered about. 1.4.1.5 says:

	For example, ``nil'' and ``the value of *standard-output*''
	are operationally indistinguishable as stream designators.

And indeed, the Glossary entry says:

	stream designator n. a designator for a stream; that is, an
	object that denotes a stream and that is one of: t (denoting
	the value of *terminal-io*), nil (denoting the value of
	*standard-input* for input stream designators or denoting
	the value of *standard-output* for output stream designators),
	or a stream (denoting itself). 

So why does FORMAT -- apparently uniquely among output functions --
interpret NIL and T as destinations differently than the normal convention
for stream designators? Mere convenience? (...and historical compatibility
too, I'm guessing.)

I'm not really complaining, just asking. Certainly this:

	(format nil "blah, blah ~S ~S~%" foo bar)

is more convenient than this:

	(with-output-to-string (s)
	  (format s "blah, blah ~S ~S~%" foo bar))

But was that the only reason, convenience?


-Rob

-----
Rob Warnock, PP-ASEL-IA		<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607