Skip to content

Glossary rebols view

Christopher Ross-Gill edited this page Aug 1, 2016 · 1 revision

The Rebol User Community Glossary

Add your own definitions of existing topic, or add new topics.
The objective is to paint a picture of many colours regarding the understanding of some crucial Rebol concepts.

Table of Contents

words


Bluey
A note about words. Rebol uses multiple phases during interpretation of scripts. Words are only symbols until evaluated. This is normally of little concern, but there are times when this distinction needs to be understood. For example; Rebol includes an important datatype! called none!. The value none is the only value with this datatype. Evaluation of words occurs in very specific and clear circumstances, and normally in a script, the symbol none will be evaluated to the value none, without the developer thinking about it.


Within a block! this may not be the case.  Words inside blocks, like all other words, remain as symbols until
evaluated.  The code

a: none
when evaluated in a script, assigns the value none to the word a as the symbol none is evaluated to the value none. The code
b: [none]
assigns the block! containing the symbol none to the word b. So the code
c: first b
assigns the symbol none to the word c. The values set in the words a and c are different. a has the value none and c has the symbol none. All values have a lexical form, the text #[none] is loaded by Rebol as the value none. Furthering the above example;
c: first [#[none]]
assigns the value none to the word c. Bluey 16:55, 25 August 2007 (EDT)
Bluey correction 1
Ok, so I've had an incorrect view of Rebol pretty much since day 1. Rebol is not word based, it is value based. Source text is treated as VALUES; and these values have a type and content, or the value of the value so to speak. So the source text that looks like
1
is a value with a type of integer! and a content of 1. The source text that looks like
a: 1
is two values. The first is a:, and this value is of type set-word! and the content is a or is it a:?. Now this leads to the content of the set-word! a: becoming another value of type word!, with a spelling of a. This word! value, refers to some value slots; one for spelling and one for context. The context is used by Rebol to keeping track of the various word spellings, much like a dictionary. In this a: 1 case, the value with a type of word! will refer to a value of type integer! with a content of 1. I'm leaving the previous definition in the document, but I think it can safely be ignored as wrong minded. The concepts mentioned for none as still worthy, but needs to be defined in terms of values as described in this update. My view may change still. Rebol is deep and understanding comes in small steps somedays and leaps and bounds on others. Bluey 03:51, 27 August 2007 (EDT)
Ladislav
My (Ladislav) take: Rebol source text is converted (by the load function) to a Rebol block containing Rebol values; and these values have a type and other contents. So the source text that looks like
1
is converted by load to a block containing one value with a type of integer! and a numeric value of 1. The source text that looks like
a: 1
is converted to a block containing two values. The first one is a:; this value is of the set-word! type and its other contents are its spelling "a" and its binding to the global context. After the block is interpreted by the do function, the word a is caused to refer to the integer value 1, which actually means, that the "global context slot" corresponding to the word a is caused to refer to the integer.
Clone this wiki locally