|REBOL 3 Docs||Guide||Concepts||Functions||Datatypes||Errors|
|TOC < Back Next >||Updated: 26-Mar-2009 Edit History|
REBOL Expressions are based on this concept: you combine values and words into blocks.
In scripts, a block is normally enclosed with square brackets [ ]. Everything within the square brackets is part of the block. The block contents can span any number of lines, and its format is completely freeform. The following examples show various ways of formatting block content:
[white red green blue yellow orange black] ["Spielberg" "Back to the Future" 1:56:20 MCA] [ "Bill" email@example.com #315-555-1234 "Steve" firstname.lastname@example.org #408-555-4321 "Ted" email@example.com #213-555-1010 ] sites: [ http://www.rebol.com [save %reb.html data] http://www.cnn.com [print data] ftp://www.amiga.com [send firstname.lastname@example.org data] ]
Some blocks do not require square brackets, because they are implied. For example, in a REBOL script, there are no brackets around the entire script, however, the script content is a block. The square brackets of an outer-block of the script are implied. The same is true for expressions typed at the command prompt or for REBOL messages sent between computers--each is an implied block.
Another important aspect of blocks is that they imply additional information. Blocks group a set of values in a particular order. That is, a block can be used as a data set as well as a sequence. This will be described in more detail in the series Chapter. =!
|TOC < Back Next >||REBOL.com - WIP Wiki||Feedback Admin|