brownplt/pyret-lang — pull request #103 by blerner (2013-11-08 22:33:57+00:00)
Title: An initial implementaion of Shadowed vars

I took a crack at implementing a `shadow` keyword as requested by issue #98. It seems to work correctly, and passes all tests. There is one subtle behavior that you might like, or might not -- I'm not sure whether I do or not, yet. The following code behaves weirdly:

x = 5
fun foo(shadow x):
var shadow x = x
x
end
f(x)

This function returns `#`, because the `x` on the right-hand side of line 3 is the same unintiialized `x` as is defined on line 3. Perhaps this should be caught by the use-before-def checker, but this is one place where I guess I *don't* like the letrec semantics of bindings in blocks...