On 12/17/1999 at 1:04 PM Elan <[EMAIL PROTECTED]> wrote:

> Much ado about nothing? Perhaps.

Much ado, but * not * about nothing. 

One of the striking things about REBOL is that it moves from the
general to the specific, where other languages, I think, may move from
the specific to the general. The difference between deduction and
induction. 

For example, in REBOL, you can define a word to be any kind of value.
Values in REBOL include blocks, and block can store code or data. When
we assign a scalar or series value to a word, we call it a variable.
When we assign a block of code to the word, we call it a function. But
they are both words. 

Also, as Elan pointed out, the datatype follows the value -- not the
word. So we can reassign some other value, with some other datatype, to
any REBOL word whenever we want. If A is defined with an integer value,
we can use it an arithmetic operation. If A is bound to a string value,
we can't, and REBOL generates an error. 

So, in REBOL, whether a word is a variable or a function or a object
depends on its current value -- its ~context~. On one line A can be an
integer, on the next A can be a function. Paradoxically, REBOL is still
a strongly-typed language, since it prevents you from using the value
of A in the wrong context (e.g. a string in an arithmetic expression). 

This also helps to explain how REBOL can so effortless return any value
from a function (including other functions), and provide seamless
object inheritance. 

How this would be implemented is another great mystery. As Elan pointed
out, in conventional compiler construction, we would set aside a space
in memory to store A's value, and the space would be determined by A's
type. In REBOL, words can be assigned any value of any size, and so the
interpreter must be aggressively managing the space A's value requires
as it changes context. (Or in the case of a series, even the global
value itself changes size.) 

Here's a sip of wine from the new manual: Simple values evaluate to
themselves. If you type an email address at the REBOL prompt, it
evaluates to the email address. The same is true of integers, strings,
issues, et al. Again, the datatype follows the value - if it did not,
REBOL could not evaluate simple values this way. 

Again, Elan's is a vital observation that is easy to glaze over.

-Ted.


Reply via email to