Example of a minimal module
Ok, you've heard about REBOL modules, and we've made a lot of changes recently... but, you're not really sure how to make one. Here's an example. It's very simple.
First, create a module file. This one is saved as simple.reb:
title: "Simple module"
export num: 1234
export sum: func ["Example" val] [val + num]
Notice it look like a normal script, but we specify the type module and the word export is used to indicate exported words.
Now, in your program, you can either import the module:
Or, another way is to specify it in the header of your program:
title: "Main program"
Then you can easily access the exported functions and data of the module:
Of course, this is just scratching the surface of what modules can do. But, I wanted to start with a simple example to show how easy it is to get going. It's that easy.