nddrylliog/rock — pull request #438 by shamanas (2012-06-16 20:29:03+00:00)
Title: Closes #436

I think I took care of any possibility so that we don't get duplicate function declarations.
This code compiles:

f: func(g: Func) {
g()
}

g: func {
foo := 42
f(|| f(|| f(|| f(|| foo toString() println()))))
}

g()

And prints out 42, as expected.
Also, twisted stuff like the following compile too:

id: func(x: Int) -> Int { x }

f: func(g: Func(Func(Int)->Int)) {
g(|x| x)
}

g: func {
foo := 42
f(|g| f(|h| f(|j| g(foo) toString() println())))
}

g()

Which previously failed

I may be missing something as I am too tired right now so it would be ideal if you could also take a look at my code.