indutny/candor — Issue #5: nested scopes breaking variables
Author: creationix
Created: 2012-03-08 22:30:19+00:00
State: open

When a function has a scope inside a function it creates, strange things happen to the value of local variables. Also the number of scope names in the current scope affect how these variables change.

```candor
((fn) {
scope print
print("fn", fn)
fn2 = fn
return () {
// If I scope fn here, then fn in the parent becomes nil
// If I scope the alias fn2, then the local fn2 is 0
scope fn, fn2, print
print("fn2", fn2)
fn2(42)
}
})((num) {
scope print
print("num", num)
})()
```