You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing the same symbol from two different libraries (like eval) requires you to fully qualify one of them, in order to disambiguate them. This can become tedious with long module names.
To relief that it would be helpful to assign aliases to modules on import, e.g. like import demo::lang::Exp::Concrete::WithLayout::Syntax as ConSyn; and later refer to the contained symbol Exp as ConSyn::Exp rather than demo::lang::Exp::Concrete::WithLayout::Syntax::Exp.
There is another feature which is a bit similar already present, module resources, but it does not have exactly the same functionality of providing an abbreviation in the local module scope. This feature generates a module with a given name at compile time. I think we have to consider module aliases with this feature in mind, and also the design of type aliases should be consistent.
It is currently possible to use type aliases as a (weak) workaround; say:
alias ConSynExp = demo::lang::Exp::Concrete::WithLayout::Syntax::Exp;
But you'd have to do that for every type you want to use in the module :-(
Let's leave this as a duplicate of #775 with these additional comments. We've a language design freeze until the compiler bootstraps, so it might take a few months before we start discussing this one again.
Importing the same symbol from two different libraries (like
eval
) requires you to fully qualify one of them, in order to disambiguate them. This can become tedious with long module names.To relief that it would be helpful to assign aliases to modules on import, e.g. like
import demo::lang::Exp::Concrete::WithLayout::Syntax as ConSyn;
and later refer to the contained symbolExp
asConSyn::Exp
rather thandemo::lang::Exp::Concrete::WithLayout::Syntax::Exp
.This is basically the same suggestion as in #775 .
Reference: https://stackoverflow.com/a/60186392/127465
The text was updated successfully, but these errors were encountered: