Steve Haflich
2014-01-29 01:03:07 UTC
I'm in a grumpy mood today, so I decided to take out my frustrations on the
ANS for CL, or implementations thereof. Consider carefully what the
following form should return:
(let ((v (make-array 10
:initial-contents '(0 1 2 3 4 5 6 7 8 9)
:fill-pointer 5)))
(loop for x across v
when (eql x 2) do (incf (fill-pointer v))
collect x))
ACL and SBCL both return (0 1 2 3 4). Probably every other implementation
does too. I believe the ANS requires the return to be (0 1 2 3 4 5),
although the definition in *6.1.2.1.5 The for-as-across subclause* uses
various undefined terminology. (We of X3J13 understood that the loop
specification was not our best work.)
ANS for CL, or implementations thereof. Consider carefully what the
following form should return:
(let ((v (make-array 10
:initial-contents '(0 1 2 3 4 5 6 7 8 9)
:fill-pointer 5)))
(loop for x across v
when (eql x 2) do (incf (fill-pointer v))
collect x))
ACL and SBCL both return (0 1 2 3 4). Probably every other implementation
does too. I believe the ANS requires the return to be (0 1 2 3 4 5),
although the definition in *6.1.2.1.5 The for-as-across subclause* uses
various undefined terminology. (We of X3J13 understood that the loop
specification was not our best work.)