Monday, June 10, 2013

[sjhltpdo] Unscope symbol

let { foo = ... } in let { hide foo } in foo

This should cause the compiler to signal an error.  We wish to assert that a certain symbol is not used within an inner scope, perhaps to avoid programmer typos of similar symbols. "hide foo" can also be a statement in do notation.

If we have local imports, then perhaps syntax like let { import OUTER-SCOPE hiding (foo) }, where OUTER-SCOPE is a new keyword.

We could also hide everything in the outer scope except a few symbols.  let { import OUTER-SCOPE(foo); import Prelude }.

No comments: