Skip to content

Fix lexical scoping

Compare
Choose a tag to compare
@dcutting dcutting released this 03 Apr 00:21
· 28 commits to master since this release

Song is supposed to be lexically scoped, but a bug meant that in many cases it was actually dynamically scoped leading to lots of confusion.

E.g. the following was surprisingly returning 2 rather than throwing an error:

foo() = n
bar(n) = foo()
bar(2)

This release tightens up the lexical scoping rules to behave as you would expect in most functional and C-style languages.