I forgot to illustrate the behavior with the patch. So, here it is:
* (loop with stack = (make-array 2 :fill-pointer 2 :initial-element t)
for length = (length stack)
while (plusp length)
for element = (vector-pop stack)
collect element)
debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread #<THREAD "initial thread" RUNNING {A9DF7F1}>:
iteration in LOOP follows body code
current LOOP context: FOR ELEMENT = (VECTOR-POP STACK) COLLECT.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-LOOP::LOOP-ERROR "iteration in LOOP follows body code")[:EXTERNAL]
0]
I forgot to illustrate the behavior with the patch. So, here it is:
* (loop with stack = (make-array 2 :fill-pointer 2 :initial-element t)
for length = (length stack)
while (plusp length)
for element = (vector-pop stack)
collect element)
debugger invoked on a SB-INT: SIMPLE- PROGRAM- ERROR in thread #<THREAD
" initial thread" RUNNING
{ A9DF7F1} >:
iteration in LOOP follows body code
current LOOP context: FOR ELEMENT = (VECTOR-POP STACK) COLLECT.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly- abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-LOOP: :LOOP-ERROR "iteration in LOOP follows body code")[:EXTERNAL]
0]