Hi Petr,

>hmm, it has a value ... so, if "" and [] are not considered being
datatypes, it
>is very strange, and as comparison to other languages I know (well, very few
>:-), pretty uncommon, that we assign some word to the value, rather than
value
>to the word ....

I'm not quite sure I understood what you were saying correctly. 

I think that you were saying that the traditional way of thinking about the
relationship between variables (words) and values is that values are
assigned to variables (words). You noticed that I was saying that words are
assigned to values. I.e. I exchanged which of the two is assigned to the
other:

traditional programming languages: value  === assigned-to ==> variable
REBOL                            : word   === assigned-as-reference-to ==>
value

I think that this is the proper way of expressing the relationship between
words and values in REBOL, in order to emphasize that words are only very
loosely related to the values they reference. Specifically, words do not
own a value. Since words do not own a value, I prefer to formulate the
relationship in such a way that he difference becomes noticable. If I
continue to use the idea that words are assigned their respective values,
then I more easily think of words as being very similar to variables in
other languages. They are not all that similar. They are different in
important ways.

What do I mean by saying that a word does not own a value? In contrast to
REBOL, in traditional programming languages there is a very strong
relationship between variables and values. Variables are named storages for
the values they represent. Therefore - normally - variables have to be
declared as being of a certain datatype. This permits the compiler to
determine how much memory to reserve for a variable, so that the variable
will be able accomodate values of its (the variables) datatype. It tells
the compiler more, such as which kinds of operations are permissible on the
variable. C for instance uses type casts (as does Pascal and Oberon) to
permit operations to be performed on variables, whose assigned type
normally precludes these kind of operations. It is the type assigned to the
VARIABLE that normally precludes operations on the VALUE. Ultimately, a
value in these programming languages is simply one or more bytes. Whether
these bytes belong together, i.e. in the case of struct (C) or record
(Pascal) is determined by the variable that owns their storage. The fact
that the storage for the values and valid operations on the value are part
of the variable constitutes a very immediate and strong relationship
between the value and the variable, a relationship in which one can easily
say that the variable owns the value.

In REBOL a value has its own memory storage, the word that references the
variable does not provide storage space for it. A word in REBOL is more
like a pointer in C or Pascal, then like a variable in either languages.
(Similar but not the same)..

In REBOL the value has a datatype, not the word. Therefore all operations
that have to do with memory storage or iterating over the elements of a
value, the range of a value etc. are all part of the information that is
packaged in the value. A word knows nothing of this. A word is nothing more
than a reference to a value. It is even more ignorant of the value's
specifics then a pointer in C or Pascal. Remember that a pointer also
posseses a type, which is assigned to the pointer at the time it is
declared. In REBOL, the value contains all the information regarding its
type, structure, and data. The word knows nothing of this.

So, seeing as a value is self-contained thing, an autonomous thing that
does not require to be referenced by a variable, I prefer to think of the
word as being assigned as a reference to a value, then thinking of the
value being assigned to the word. I don't think that anyone will mistake
this to mean that the value owns the word. It doesn't. As programmer's we
are not biased towards assuming that a value owns a variable. Therefore I
trust that no one will misunderstand my formulation of assigning a word as
a reference to a value (or assigning a word to a value, for short) as
suggesting that the value stands in an ownership relationship to the word.
I just mean to use an unusual formulation as a reminder that words are not
the same thing as variables in other programming languages.

I notice that I repeat myself in trying to emphasize the autnomous natures
of a value. This is because its easily said in a few words, but it takes
some time to sink in. 

Much ado about nothing? Perhaps.

Elan

Reply via email to