Type | Wish | Status | submitted | Date | 26-Feb-2014 01:54 |
---|---|---|---|---|---|
Version | r3 master | Category | Mezzanine | Submitted by | BrianH |
Platform | All | Severity | minor | Priority | normal |
Summary | Specify selective export list in module/script Needs header |
---|---|
Description |
This has been requested by several different developers of advanced modular Rebol code (especially Andreas and Maxim). The trick has been to figure out a simple meaning for this that works with the module system and lib model. The Needs header is a block of requirement clauses. This is a proposal to allow one to add a nested block to a requirement clause, with the same syntax as an Exports block. This block in the requirements clause would be used instead of the Exports block of the module that you are requiring, but in the same way as an Exports block. The export semantics of regular vs private modules would stay the same. Regular modules would still export to lib, and the export would still happen the first time the module is loaded. Subsequent requests for the same regular module would still continue to be noops, since they had already loaded and exported their stuff. So, if a selective export list is specified, that selection would be applied the first time the module is loaded, and ignored afterwards. Selective exports for regular modules are really only useful in app-level Needs lists, but the same is the case for all explicit references to regular modules. For private modules, exporting is local, so the list of words that you want to export would also be applied locally. If the module is referenced elsewhere with a different export list, that list would be applied there. Private modules are private. For private modules imported into scripts, which share the user context, each export to that context is applied as it would be normally, but with the list specified. There would be no change to the export semantics, just to the list of words exported. |
Example code |
Assigned to | n/a | Fixed in | - | Last Update | 26-Feb-2014 18:01 |
---|
Date | User | Field | Action | Change |
---|---|---|---|---|
26-Feb-2014 18:01 | BrianH | Summary | Modified | Specify selective export list in Needs header => Specify selective export list in module/script Needs header |
26-Feb-2014 18:01 | BrianH | Description | Modified | - |
26-Feb-2014 01:54 | BrianH | Ticket | Added | - |