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

Strings as streams

    Date: Tue, 22 Mar 88 20:24:36 PST
    From: Jon L White <edsel!jonl@labrea.Stanford.EDU>

    Does anyone know whether the following point has been "clarified" at all?
    say, in Guy's previous notes about clarifications and corrections?

I don't recall this point coming up before.  It's not in 86-003.

    CLtL p386 says that formatting to a fill-pointer'd string should add
    characters "as if by use of VECTOR-PUSH-EXTEND"; but CLtL p331 says that
    with-outuput-to-string will work "as if using VECTOR-PUSH-EXTEND if the
    string is adjustable, and otherwise as if using VECTOR-PUSH".  

    Possibly the description of FORMAT merely needs the additional wording?

I think FORMAT is right and WITH-OUTPUT-TO-STRING is wrong.  If more
characters are output than will fit in the string, VECTOR-PUSH-EXTEND
either does the right thing or signals an error, depending on whether
the string is adjustable, whereas VECTOR-PUSH just throws away the
excess characters.  It seems clear to me that throwing away some
characters without signalling an error is not desirable behavior.
I suspect the mention of VECTOR-PUSH under WITH-OUTPUT-TO-STRING was
just a mistake, perhaps a momentary thought that VECTOR-PUSH-EXTEND
always signalled an error if handed a non-adjustable vector, even when
it wasn't full.

JonL, would you like to write up a cleanup proposal for this, or should I?