There is a simple patch. Before declaring a variable, we check whether its name is already used within the loop. To do that, we analyze *loop-declarations* list contents. Variables which are initialized by destructuring are described by the sublists in that list. Every sublist has a variable name as a last element.
The regression tests is coming soon. Current behavior with the fix:
* (loop with (a b) of-type float = '(1.0 2.0)
and (c a) of-type float = '(3.0 4.0)
return (list a b c))
debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread #<THREAD "initial thread" RUNNING {A9E6861}>:
duplicated variable A in a LOOP binding
current LOOP context: WITH (A B) OF-TYPE FLOAT = '(1.0 2.0) AND (C A) OF-TYPE FLOAT = '(3.0 4.0) RETURN.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
There is a simple patch. Before declaring a variable, we check whether its name is already used within the loop. To do that, we analyze *loop-declarations* list contents. Variables which are initialized by destructuring are described by the sublists in that list. Every sublist has a variable name as a last element.
The regression tests is coming soon. Current behavior with the fix:
* (loop with (a b) of-type float = '(1.0 2.0)
and (c a) of-type float = '(3.0 4.0)
return (list a b c))
debugger invoked on a SB-INT: SIMPLE- PROGRAM- ERROR in thread #<THREAD
" initial thread" RUNNING
{ A9E6861} >:
A) OF-TYPE FLOAT = '(3.0
4.0) RETURN.
duplicated variable A in a LOOP binding
current LOOP context: WITH (A B) OF-TYPE FLOAT = '(1.0 2.0) AND (C
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.