[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: robbins@DEC-HUDSON.ARPA
- Subject: with-output-to-string query
- From: "Scott E. Fahlman" <Fahlman@CMU-CS-C.ARPA>
- Date: Fri, 16 Aug 1985 19:41:00 -0000
- Cc: common-lisp@SU-AI.ARPA
- In-reply-to: Msg of 16 Aug 1985 14:59-EDT from robbins at DEC-HUDSON
- Sender: FAHLMAN@CMU-CS-C.ARPA
The definition of WITH-OUTPUT-TO-STRING given in the Common Lisp
reference manual states that:
"If string is specified ... the output is incrementally appended to the
string, as if using VECTOR-PUSH-EXTEND if the string is adjustable, and
otherwise as if using VECTOR-PUSH."
This implies that after a non-adjustable output string is "filled" any
extra characters output to it will simply be dropped and no error will
be signalled. Is this correct?
Yeah, given that VECTOR-PUSH is documented not to complain when a
non-adjustable string overflows, it seems to follow that
WITH-OUTPUT-TO-STRING should just ignore excess output in this case and
not signal an error. This seems like a treacherous mechanism that could
screw the unwary, but in the vast majoirty of cases users will let the
system create the string or will use an adjustable one if this meant to
implement some sort of non-consing buffer.
I'm not sure why we decided that VECTOR-PUSH should fail silently, but
we must have had some good reason at the time. Probably we just copied
Zetalisp and THEY had a good reason.