r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3 Modules] Get help with R3's module system

Andreas
28-Jan-2011
[299x3]
To be more precise: having a default which is actually intended _not_ 
to be used does not make much sense.
Having a default which _is_ intended to be used would be a strong 
incentive for both authors and distributors to stick with this default.
This vastly reduces friction within the wider ecosystem, making life 
easier for all parties involved.
BrianH
28-Jan-2011
[302]
I can only say that Carl set the default, but I haven't seen any 
published scripts by him that use it. Good point, Andreas. Too bad 
we can't settle on .r, because R has taken that extension in most 
standard tools, and OSX uses .r for something else.
Ashley
28-Jan-2011
[303]
.rez resource files. It's a pain.
BrianH
4-Oct-2011
[304x2:last]
Here's another interesting trick: Make %rebol.r a unnamed module 
by putting type: module in its header and not giving it it a name. 
This isolates the words in it in its own context instead of putting 
them in the user context, controls the visibility of its code, and 
makes it easier to free up the memory it uses because its context 
is thrown away afterwards. It's the perfect occasion for an unnamed 
module: run once, and done for effect.


%rebol.r is a great place to set your preferred system/options/module-paths 
and system/options/default-suffix, to delay-load commonly used modules 
and extensions that you have checked out already, and to patch or 
wrap anything that you need to.
%rebol.r is run before any user code is run, even the --do and --import 
args. This makes it the best place to hack the module system for 
your own uses.