Bug stepping through loops

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug stepping through loops

Chris Uppal-3
I'm not sure whether it'd have been better to post this on the main ng.  It
affects D4 too, but I assume that bugs are only really being fixed in D5.

In a workspace do:
    i := 1 to: 100.

Then F11 into:
    i from: 20 to: 40 keysAndValuesDo:
        [:key :val | Transcript
                            print: key;
                            space;
                            print: val;
                            cr].

Meanwhile (in the original workspace) evaluating:
    i.
from time to time.  As you step into Interval>>from:to:keysAndValuesDo: you
should see the value of i in the *workspace* change from (1 to: 100) to 20.

It looks as if the "loop" variable i in #from:to:keysAndValuesDo: is somehow
interfering with the same-named variable in an outer context.  Putting more
layers of nesting between the workspace and the inner loop -- e.g. using
#do: -- has the same effect.

This only happens under the debugger.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Bug stepping through loops

Blair McGlashan
"Chris Uppal" <[hidden email]> wrote in message
news:[hidden email]...
> I'm not sure whether it'd have been better to post this on the main ng.
It

> affects D4 too, but I assume that bugs are only really being fixed in D5.
>
> In a workspace do:
>     i := 1 to: 100.
>
> Then F11 into:
>     i from: 20 to: 40 keysAndValuesDo:
>         [:key :val | Transcript
>                             print: key;
>                             space;
>                             print: val;
>                             cr].
>
> Meanwhile (in the original workspace) evaluating:
>     i.
> from time to time.  As you step into Interval>>from:to:keysAndValuesDo:
you
> should see the value of i in the *workspace* change from (1 to: 100) to
20.
>
> It looks as if the "loop" variable i in #from:to:keysAndValuesDo: is
somehow
> interfering with the same-named variable in an outer context.  Putting
more
> layers of nesting between the workspace and the inner loop -- e.g. using
> #do: -- has the same effect.
>
> This only happens under the debugger.

Thanks Chris, #672.

(Initial analysis: The Debugger is messing up the handling of the temps, its
not a VM issue).

Regards

Blair