gap> f := function()
>     local i;
>     for i in 1 do
>         return 1;
>     od;
>     return 2;
> end;;
gap> f();
Error, You cannot loop over the integer 1 did you mean the range [1..1]
Stack trace:
*[1] Error( "You cannot loop over the integer ", n, " did you mean the range [1..", n, "]" );
   @ GAPROOT/lib/integer.gi:LINE
 [2] for i in 1 do
    return 1;
od;
   @ *stdin*:6
<function "f">( <arguments> )
 called from read-eval loop at *stdin*:9
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk> ContentsLVars(CurrentEnv());
rec( func := function( n ) ... end, names := [ "n" ], values := [ 1 ] )
brk> DownEnv(); ContentsLVars(CurrentEnv());
rec( func := function(  ) ... end, names := [ "i" ], values := [  ] )
brk> DownEnv(); ContentsLVars(CurrentEnv());
rec( func := function(  ) ... end, names := [ "i" ], values := [  ] )
brk> quit;
gap> QUIT;
