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

FORMAT-NEGATIVE-PARAMETERS



[Removed Berman, Common-Lisp; added CL-Cleanup]

    Date: Tue, 19 May 1987  15:19 EDT
    From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>

	Date: 19 May 1987  14:38-EDT
	From: Richard Berman <berman at vaxa.isi.edu>

	... do you know what this should do?

	(FORMAT NIL "~-1%")

    ... there seem to be a number of places in the format directives where
    negative numbers would make no sense.  I don't think that all of these
    are explicitly flagged.  This should probably be fixed up in the
    standard, but until then it seems reasonable to assume non-negative
    integers unless there's some obvious meaning for the negative case.

This would be a reasonable topic for us to address in CL-Cleanup.

I agree that a reasonable approach for the interim, and in fact in the
next edition of the manual, is to say that format parameters are assumed
to be non-negative integers except as specifically stated. Of course, we'll
need to specify clearly whether signalling an error or assuming 0 or whatever
is the right thing otherwise, and that should perhaps be done by someone who
has surveyed all the ops to determine the likely impact on typical code of
assuming 0, etc.

Cases where some implementations signal an error and others quietly ignore
the error are what drive developers of portable code nuts.

By the way, I note that this case is most important where the user has
written ~V%, since it's not statically detectable in that case that a problem
has arisen. 

Obviously, someone should write this up as a formal proposal. I've picked
the issue name FORMAT-NEGATIVE-PARAMETERS above and this message can be used
to seed the proposal when someone has time to write it.