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

Functions must be declared before use #8

Open mna opened 10 years ago

mna commented 10 years ago

Remove this constraint in future versions, especially since it is impossible to use a pair of mutually depended upon functions at the moment.

mna commented 10 years ago

Maybe: make func statements (i.e. func SomeName() {}) accessible even before declaration, but func expressions (i.e. SomeName := func() {}) accessible only from the point of declaration forward. That's pretty much how it works in Go (well, func expressions cannot be used in top-level, and func statements cannot be used within a func, so the comparison is not accurate).