REBOL

Rebol Articles

Author: Ladislav Mecir
Date: 26-Sep-2011/14:35:52+2:00

Contents:

1. References
1.1 BEER1 SDK
2. Documentation
3. Useful Functions
3.1 Include
3.2 Other
4. Dialects
4.1 BUILD
4.2 Spider
4.3 Control functions
4.4 Error Handling
4.5 Func Replacements
4.6 HOF's
5. Matrix operations
6. Statistic functions
7. Miscellaneous

1. References

What is REBOL can be found in the Wikipedia article.

The Rebol programming wikibook is a valuable resource as well.

The official Rebol pages are at Rebol Technologies site. You can find Rebol Documentation there.

REBOL developer site can be found here.

Another official Rebol site is the Rebol org site. There you can find REBOL library and REBOL mailing list archive.

Useful informations can be found at the Rebol Forces site.

Rugby can be found at Maarten Koopmans' site.

MySQL drivers and clients, as well as other useful software are at Doc Kimbel's site.

1.1 BEER1 SDK

BEER1 SDK

2. Documentation

The Series article answers "everything you wanted to know about series, but were afraid to ask".

How is Rebol source code interpreted? You can find out in the Interpreter article.

How many arguments can a Rebol function take? The answer can be found in the Arguments article. Which types of argument passing Rebol uses? The answer can be found in the Rebol Argument Passing article.

Have you got trouble deciding whether two Rebol expressions yield one value? You can read the Identity article.

Are Rebol words, contexts, scope, and binding a mystery for you? Try the Bindology article.

Details about the implementation of the decimal! datatype in REBOL are in the Decimals-64 article.

The Parse versus RE article describes the differences between parse expressions, regular expressions, generative grammars, etc.

A detailed Parse description can be found in this Parse article.

3. Useful Functions

3.1 Include

The function I use the most often is certainly my INCLUDE function defined in the include.r file and described in INCLUDE documentation article. If you want to use some of my functions, I strongly recommend to use this function. If you don't want to download my functions to your computer, you can just:

do http://www.fm.tul.cz/~ladislav/rebol/include.r
append include-path http://www.fm.tul.cz/~ladislav/rebol/

and then you can use any function listed below as follows:

include %some-file.r

My functions resolve dependencies using the Include function and you can use it to link some files together for encap purposes e.g.

To see how I ported it to R3 have a look at the porting article.

3.2 Other

The Nargs Higher Order Function (I use the notion of HOF to characterize functions that take other functions as their arguments or for functions that return functions as their results) by Carl Sassenrath finds the number of function arguments. See the Argstake article for additional details.

LOCALS? HOF finds the local variables of a function.

Set-words function collects all set-words contained in a block.

The Enum function is fairly simple. It just creates a block filled with a sequence of numbers.

4. Dialects

4.1 BUILD

I wrote a new version of my Build Dialect, that can serve as a more comfortable and human readable COMPOSE replacement.

4.2 Spider

The Spider Dialect can be used in a Draw block to draw a spider- (also known as web-) type graph.

4.3 Control functions

My general loop Cfor control function is more comfortable, reliable, flexible and faster than the For mezzanine.

Pif function is a "cousin" of the IF control function and a compatible predecessor of the native Case function using "many" variants.

4.4 Error Handling

See my notes about some specific error issues in the Errors As Results article.

My newest error handling routine is the Default function, where you can specify the way how the error is handled.

4.5 Func Replacements

The Bindology article describes the Funcs function, which is a comfortable Func replacement automatically defining local variables. Questions have been asked whether we can define functions with static local variables. Automatic definition of static variables is another strong point of Funcs.

Function Attributes article describes the Tfunc function, which can be found in the tfunc.r file. The usage of the Tfunc function is suggested, if you want to define a new dialect, a new control function etc. The rule of thumb is, that if your function executes some "foreign" code you should consider Tfunc instead of using function attributes.

The Closure function mentioned above as well as in the Bindology article is able to define closures, see the example in the source. It can be used to define other HOF's.

Tailfunc function can be used to define tail-recursive functions.

4.6 HOF's

The Apply function is handy if you want to supply a block of arguments and refinements to a function. See the examples in the file. Another possible usage is safe evaluation of functions supplying arguments without their evaluation.

The Accumulate function is devised to perform general accumulation into a given accumulator value using a UNIFY function.

Curry HOF creates curried functions, i.e. functions taking only a subset of arguments of the original function. In the file you can find the application of Curry to the definition of the Composition HOF.

Another function mentioned in the Bindology article is the Nm-use function.

Refined HOF creates a function, that does, what would the given function with the given refinements do.

There was a discussion about argument passing as well as a discussion about an Anti-function. The file pass-args.r contains an implementation of an argument passing function able to pass all kinds of named arguments (evaluated, literal and fetched) to the called function and an implementation of an Anti-function.

Function Inheritance HOFs Gabriele used to define his Custom Datatypes, although its use isn't limited to just that.

Tuntil and Twhile functions are special cycle functions, that are "transparent" for "foreign" Return, Exit, Break and Throw. They can be handy when you are defining new control functions. Moreover, the functions support the usage of local Break. (The implementations are somewhat "outdate", there is a way that may be even better, so if you want a newer version of such a function, ask on Rebol ML or AltMe)

5. Matrix operations

The matrix.r file contains a small collection of matrix operations.

6. Statistic functions

See the presentation.

7. Miscellaneous

The Msort function is a stable and fast sorting function using an auxiliary array at most half the size of the original having no exceptional cases.

The timblk.r file contains functions that can precisely measure execution time of Rebol blocks.

The bench.r file contains a benchmark I use to test the speed of computer/interpreter. There is also a rebcode using variant of the benchmark. My test result history can be found in the tests.txt file.

The daytime.r file contains a simple daytime server.

The library-utils.r file contains functions that allow you to handle some common C library interface tasks and more.

The evaluate.r file shows a way how to define evaluators/interpreters/compilers for arithmetic expressions using various operator precedence and associativity rule sets.

The nistclock.r file allows you to show and set up accurate time using NIST time service.

The end.

MakeDoc2 by REBOL - 26-Sep-2011