We want to improve the module signatures feature by allowing the type of "import foo from BAR` syntax present in most other import systems. Here are three possible syntaxes for consideration:
- Sentence label
module FOO
syntax [foo]: Foo ::= foo(Foo)
syntax [bar]: Foo ::= foo(Bar)
endmodule
module BAR
imports FOO.foo
imports FOO.foo as bar(_)
endmodule
Potential problems: you can't import something without help from someone who can modify the module being imported from. You also have trouble with sentence labels and pipes mixing.
- Sentence tag
module FOO
syntax Foo ::= foo(Foo) [tag(foo)]
syntax Foo ::= foo(Bar) [tag(bar)]
endmodule
module BAR
imports FOO.foo
imports FOO.foo as bar(_)
endmodule
Basically the same but uses the tag attribute instead of the sentence label. Allows multiple sentences to be given the same tag, which could introduce complexity when it comes to renaming.
- Explicit syntax
module FOO
syntax Foo ::= foo(Foo)
syntax Foo ::= foo(Bar)
endmodule
module BAR
imports
syntax Foo ::= foo(Foo)
syntax Bar ::= foo(Bar) => bar(_)
from FOO
endmodule
Requires you to basically redeclare what you import, but is the most flexible.
We want to improve the module signatures feature by allowing the type of "import foo from BAR` syntax present in most other import systems. Here are three possible syntaxes for consideration:
Potential problems: you can't import something without help from someone who can modify the module being imported from. You also have trouble with sentence labels and pipes mixing.
Basically the same but uses the tag attribute instead of the sentence label. Allows multiple sentences to be given the same tag, which could introduce complexity when it comes to renaming.
Requires you to basically redeclare what you import, but is the most flexible.