feat: improved export
command, namespace aliases
#6393
+489
−80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR gives the
export
command the ability to create aliases to namespaces, in addition to its current ability to create aliases to individual declarations. It adds a number ofopen
-like variations to the syntax.export NS1 ... NSn
makes the current namespace be an alias for the provided namespaces.export NS (def1 ... defn)
has the same meaning as before, but if anyNS.defi
is a namespace then the alias also serves as a namespace alias. For example, if one were to doMyNS.Name
available as an alias forName
, but now additionallyMyNS.Name.str
is an alias forLean.Name.str
.export NS hiding def1 ... defn
is likeexport NS
, but the given namesdef1
throughdefn
inNS
do not get aliases.export NS renaming def1 -> def1', ..., defn -> defn'
creates aliases for the given namesdef1
throughdefn
, but the aliases respectively use the namesdef1'
throughdefn'
.Closes #6394 (RFC)