joel.neely@fedex>> clear b

The problem with CLEAR has been classified as a bug, and is being
handled under ticket #1593. I'm told the REBOL language fully supports,
and even encourages, multiple references to the same series, but the
REBOL interpreter needs to be fixed.

>> My reading of the dictionary, tutorials, and 'help left me with the
impression that the term "series" was being used to cover two closely
related but distinct concepts.  

Consider this from the new manual
<http://www.rebol.com/manual/expwords.html#GettingWords>:

{
drucken: :print
defines a new word, drucken (which is German for "print"), to refer to
the same function print does
}

~.. to refer to the SAME function print does.~

In REBOL, all words (including the series variables) are references to
an underlying value. For PRINT, it is a block defined as a function.
For a series, variable it is the set of values. The principle is more
obvious in the series, since there is a second value (the SERIES INDEX)
involved, and the other value is "anonymous" by contrast. But it is the
same, consistent, approach in case of the functions DRUCKEN and PRINT
as it is in the series A, B, and C.

It just isn't the approach many of us would expect.

Just as you can define two words that refer to the same set-of-values,
you can define two words that refer to the same function. In the above
example, both PRINT and DRUCKEN are exact equivalents; theoretically,
one is no better than the other. The word PRINT was just
conincidentally assigned to the function first. The word is not the
function, or the value, it is a reference.

This behaviour, incidentally, would be fundamental to developing the
much-ballyhooed dialects.

Also consider this
<http://www.rebol.com/manual/expwords.html#UnsetWords>:

"Before a word is set to a value, it is unset."

Now this doesn't mean the value vanishes, it just means the reference
is made none and/or set to refer to another value. 

(And, presumably, when all references to a value disappear, the value
is finally disposed.)

Experience with other languages leads people to assume that the word is
a synonym for a locaton in memory where the value is stored. This is
not how REBOL works. All the words are references to the value. (Or
something like a pointer is conventional terms.) 

The underlying value hasn't been given a cannonical term in REBOL,
apparently because it is not exposed by the language. If a term is
coined, it must be carefully chosen, since it would apply to storage of
all values in REBOL, not just the set of values in a series.

If REBOL were a relational database, the values would be stored in one
table, and the words stored in another. Each word stores an
system-generated key for the value, and looks-up the current value as
needed. As a DBMS, we would say that the word is related to the value.
In REBOL, we say the word is bound to the value. 

Properties like the datatype woud be stored in the value-table, not the
word-table. Of course, there would also be provision in the table for
the current context. And, when the last word referring to a value is
unset, then the value-record is removed as well (from the related
table). 

(Of course, REBOL is not a relational database, and I have no idea how
its behaviour is implemented, and it is most certainly NOT as tables.)

In most popular languages, there is a 1:1 relationship between a
variable and a value. We sometimes circumvent that relationship by
defining additional "pointers" to same location in memory. But in
REBOL, the native relationship is many:1 - many words can refer to the
same value.

Agreed, REBOL eventually needs an appendix which constrasts how this
language works compared to other popular languages. But this is the
ground floor, and they are probably concentrating on defining REBOL on
its own terms first. This list is also a place where REBOL can learn
what is confusing the new "old-hands" who have not been indocternated
to its mysteries.

>>the term "series" was being used to cover two closely related
butdistinct concepts.  

The documentation does overload the term, using it to refer to both the
series-variable and to the underlying set of values, depending on
context. Much the same way we refer to a language and its interpreter
using the same term. (Write a script in REBOL and then submit it to
REBOL.) And also much the same way we might refer to PRINT as if it
were the function itself (which is it not!).

It's important to note that a series returns its current position as a
~copy~ of the index value, but the rest of the series is returned as a
reference. This behaviour is designed so that you can easily create two
indexes into the same series.

[EMAIL PROTECTED]>>  I just wonder, why are REBOL Tech. folks so
silent? Why not enter the discussion, introducing proper solution? I
would expect it from language creators.

Well, if they are silent long enough, we might just do the work for
them. Which is good, since I am sure they have plenty to do!

-Ted.


Reply via email to