How to View Source Code
To help you learn REBOL, you can view the source code to most scripts and functions directly from the REBOL console.
For example, to see the source code to Gabriele's Bubbles demo, open the REBOL console and type:
print read http://www.rebol.com/view/demos/bubbles.r
If you're using REBOL/View, you can also open it with a simple editor:
If you want to save the source code to open it with your own editor, do this:
write %bubbles.r read http://www.rebol.com/view/demos/bubbles.r
Of course, to just run the script, you can type:
Viewing Function Code
You can view the source code to REBOL-based functions by using the source function.
For example, to see the source code for the join function, type:
source join join: func [ "Concatenates values." value "Base value" rest "Value or block of values" ][ value: either series? :value [copy value] [form :value] repend value :rest ]
Note that native functions and actions are internal and are not viewable.
Viewing Parts of the System
print mold system/options
which is the same as just:
If you attempt to write:
the resulting code will be large and take a while to print (it also includes unavoidable redundancies.) You might want to use the line:
write %system-code.r mold system
The resulting source code file will be over 100 megabytes (for R2.)