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

with-output-to-string query



    Date: Sun, 18 Aug 1985  18:19 EDT
    From: "Scott E. Fahlman" <Fahlman@CMU-CS-C.ARPA>


	It seems clear to me that no one intended WITH-OUTPUT-TO-STRING to throw away
	characters if given a non-adjustable string to fill.  Since it can't return
	a value to say whether it filled the string, it should signal an error.  I
	think this is just looseness in the manual, not a real language issue.  If
	someone else disagrees they should speak up!

    I agree that it would be preferable in this case to signal an error --
    as I said in my earlier note, it is rather treacherous to just discard
    charaters without warning.  However, the curent text of the manual seems
    to say more or less clearly (though by indirection thropugh Vector-Push)
    that no error is signalled in this case

I don't see this implication in the text.  The only thing that is clear is
that it says the output is appended to the string.

This is getting awfully rabbinical!

					   , so to "clarify" the manual as
    Moon suggests is really a change, though one in a corner so obscure that
    it wouldn't bother people too much.  Perhaps the best resolution is for
    now to say that "it is an error" to overflow the string being written,
    and to change this to "signals an error" in Common Lisp 86 (or
    whenever).

Or leave it "is an error" for all time, allowing individual implementations
to choose between safety, efficiency, and compatible with past broken
implementations.  That seems like the best resolution to me.

Of course no matter what the resolution, it doesn't affect my implementation,
since all strings are adjustable, so I'm happy.