effekt
effekt copied to clipboard
Add qualified declarations
Allow the following
def foo::bar(...) = <>
to stand for:
namespace foo { def bar(...) = <> }
export foo::bar // we can't write this yet in the surface language!
So that you can call bar with both foo::bar and "just" bar.
Later on, we could enforce this for overloaded terms (so that there's always at least one "distinguishing" call),
such as int::show, string::show, ....
This might need some tweaks in Lexer & Parser, then "unwrap" in Namer, similarly to what https://github.com/effekt-lang/effekt/pull/1092 did:
// define in namespace ...
Context.namespace(interfaceId.name) {
Context.define(id, opSym)
}
// ... and bind outside
Context.bind(opSym)
opSym
Truth be told, I'm quite tempted to sneak in Koka-style foo/bar instead :)
I would prefer if it was not available unqualified.