Paul F. Dietz <email@example.com> wrote:
| Marc Battyani wrote:
| > Maybe I should ask to the CMUCL guys why they did that change...
| I think they were fixing a bug in the :junk-allowed nil case.
Sounds right, especially since the CLHS says [emphasis added]:
The second value is either the index into the string of the
delimiter that terminated the parse, or the UPPER BOUNDING INDEX
OF THE SUBSTRING if the parse terminated at the end of the substring
(AS IS ALWAYS THE CASE IF JUNK-ALLOWED IS FALSE).
Compare CLISP-2.29 and CMUCL-18e [before the change] on the following:
clisp> (parse-integer "1 " :junk-allowed nil)
cmucl> (parse-integer "1 " :junk-allowed nil)
Given the quoted CLHS except above, one might well say that CLISP
does it "right" in this case...
p.s. However, just to be ornery, also note that:
clisp> (parse-integer "1 2" :junk-allowed t)
So at least one implementation gets the :JUNK-ALLOWED NIL case right
*without* giving 1,4 for the :JUNK-ALLOWED T case. Go figure.
Rob Warnock <firstname.lastname@example.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607