mna / agora

a dynamically typed, garbage collected, embeddable programming language built with Go
https://github.com/mna/agora/wiki
BSD 3-Clause "New" or "Revised" License
324 stars 27 forks source link

Badly scoped vars at runtime #10

Closed mna closed 10 years ago

mna commented 10 years ago

A variable with the same name as one in a parent scope doesn't get defined in its local scope, only when it doesn't exist anywhere else.

Easy fix: at compile-time, save a list of locals in the func prototype. At func instantiation, force-declare all locals before running. Removes the need for expected vars count.

mna commented 10 years ago

Fixed with integration of wip-locals branch.