robpike / ivy

ivy, an APL-like calculator
Other
1.32k stars 103 forks source link

ivy: fix multi-frame variable lookup bug #81

Closed rsc closed 2 years ago

rsc commented 2 years ago

If g is calling f, f should never read or write g's variables. But that's what Lookup was doing: reading g's variables instead of globals of the same name. Assignment was correct. This change factors out the lookup to share it between both.

rsc commented 2 years ago

Fixed comment.

robpike commented 2 years ago

Good catch.