| REBOL 3 Docs | Guide | Concepts | Functions | Datatypes | Errors |
| TOC < Back Next > | Updated: 12-Aug-2009 Edit History |
The previous section defined extensions as a package that can contain both REBOL and C code and data. This section explains how to import and use extensions.
Extensions work like modules. You must import them before they can be used. When you import an extension, you load its code and data, which can include both REBOL or C code, as well as any data they might need such as graphics, images, sounds, tables, or whatever.
To import an extension called example is as simple as:
import %example.dll
Notice that the file suffix is .dll - a dynamically loaded library. This is how native functions and their data are able to be loaded by your operating system.
The line above will perform these steps to import the extension:
See modules for more detailed information about how some of these steps are processed.
Once an extension has been imported, you can use its exported function as you would any other type of function:
import %example.dll ; exports add-mul
print add-mul 1 2 3
9
If you want to see the exported definition of the example extension, just type:
probe import %example.dll
This will show you the module header and a list of all its functions and data.
So, that's all you need to do to use extensions. Simple by design.
| TOC < Back Next > | REBOL.com - WIP Wiki | Feedback Admin |