Words and any type of values can be combined in blocks delimited by square brackets [ ]. A block is of type block!. Here is a block containing data:
;-- Chapter03/blocks.red:
[
"Jeff" [email protected] #213-555-1010
"Bill" [email protected] #315-555-1234
"Steve" [email protected] #408-555-4321
]
(In the graphical REPL on Windows and macOS, this can be copied and pasted in this layout. On Linux, where there is only a console REPL at the moment, it is not so nicely formatted).
You can convert any argument to a block with to-block—to-block {1 2 3} ;== [1 2 3].
Blocks can also contain code instructions, like this:
loop 10 [prin "hello" print " world"]
In the following code snippet, the first block [site action] contains words, which must have a value, while the second block contains code:
foreach [site action...