[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A bug in the new ANSI loop macro
- To: email@example.com
- Subject: Re: A bug in the new ANSI loop macro
- From: David Gadbois <firstname.lastname@example.org>
- Date: Wed, 12 Apr 1995 12:07:41 -0500
- Cc: "David J. Fiander" <email@example.com>
- In-reply-to: <firstname.lastname@example.org> (email@example.com)
Date: Wed, 12 Apr 95 15:07:12 +0200
From: "David J. Fiander" <firstname.lastname@example.org>
A close reading of X3J13-94-101 and the issue history indicates that
clisp is correct, at least insofar as the standard is purposefully
vague on the issue. The only LOOP bindings available in FINALLY
clauses are ones created by WITH clauses (and, by extension, INTO
phrases). It is left unspecified whether bindings created with FOR or
AS clauses are available. In most Common Lisps I am familiar with,
they are, but clisp is justified by the standard in not having them be
This issue was discussed at length on the X3J13 mailing list as
LOOP-FOR-AS-VARIABLE-TERMINATION-VALUE. I don't have my archives
handy, but I recall that the debate centered on problems with
arithmetic values being stepped past their ranges.
To get around the problem, you'd have to do something like:
(loop for char across fmt
(#\@ (setf at t))
(#\: (setf colon t)))
until (and (operatorp char)
(setf cmd char)))
Ugly, but those are the breaks.
(I'm trying to write the (formatter) macro.) The problem is that
*** - EVAL: variable CHAR has no value
in the "finally" clause. This works for the example
(for i from 1 to 10...
example from Steele.
X3J13 "solved" the problem by changing the examples in the standard
that have FOR/AS bound variables referred to in FINALLY clauses so that
they didn't anymore.
Great title for a course: "Programming as Archaeology."