Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.

Conversation

kubouch
Copy link
Contributor

@kubouch kubouch commented Sep 26, 2021

Introduces module and use keywords to define a module and import custom commands from it.

Current limitations:

  • Currently, only custom commands are supported for export
  • Also, all defs within a module are exported, there is no selective export yet, neither are the definitions hidden behind namespace
  • module also closes over its parent scope which we probably want to disallow
    • This could be handled by the same mechanic as deactivate: When entering a module scope, deactivate everything
  • No module from file yet
  • No deactivate yet
  • No nested modules yet
  • Modules are implemented as Blocks which expose what definitions are to be exported. However, we do not use the underlying Block anywhere at all, so we might change Module to be just a list of exportables.
    • If we make use to also evaluate the module, we would probably need the block

@sophiajt
Copy link
Contributor

looks good!

@sophiajt sophiajt merged commit 47421e9 into nushell:main Sep 26, 2021
@kubouch kubouch deleted the simple-module branch November 10, 2021 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants