[EMAIL PROTECTED] wrote:
> 
> A series is a block; a block is a series.
>

No.  Consider the following:

    >> argument: "I don't think so!"
    == "I don't think so!"
    >> type? argument
    == string!
    >> series? argument
    == true
    >> block? argument
    == false
    >> any-block? argument
    == false

According to REBOL (the 2.2.0.3.1 interpreter), 'argument is a series,
but NOT a block (of any kind).
 
>
> It might be helpful for you to think of a series variable as a record
> 

That was the issue I was trying to address (pardon the pun ;-).  A
series is an entity that exists separately from its underlying
sequence (NOT just a block, as the example above showed).  It is
possible to manipulate the series (specifically, the index) without
altering the underlying sequence, but if you alter the sequence, a
series that refers to it may get sick (and the current implementation
seems to be oblivious to whether a sequence has one or more series
instances that refer to it.

> 
> Without using the HEAD or TAIL functions, the operations are relative
> to the variable (or bookmark). (The notable exception being APPEND.)
> 

Understood.  But my suggestion for describing this state of affairs
is that some operations work with the series (e.g., 'next, 'length?),
while others work with the underlying sequence (e.g., 'head, 'clear).

>
> In some ways, the "problems" with series may be "Advanced Users
> Syndrome"...
> 

Perhaps I should have addressed my comments to the documentation
team, rather than the general mailing list.  However, it seemed (and
still seems) to me that some confusion arises from lumping all of
these operators together as operating on series values, when they
are really working at two different levels.  I believe the extra
level in this model makes it more immediately obvious why

    seriesreference1: next seriesreference1

is "safe" and has no side effects on any other references to the same
underlying data, while

    clear seriesreference2

may cause other references to change values and operations on other
references to throw errors.  I'm not (at this point ;-) trying to
argue whether this should be how REBOL behaves, but trying to form
the simplest possible model for understanding and explaining how it
behaves.

A big part of my own frustration in learning REBOL has been due to
my attempt to understand/reconcile REBOL features via/with my
background in other languages.  REBOL has no obligation to do things
that/like other languages do, but it's hard (at least for me!) to
approach a new language without tidbits of the conceptual models of
previously learned languages leaking through.

For example, I initially tried to understand the REBOL type hierarchy
in terms of subclass/superclass from other languages, but the current
documentation makes that very difficult.  For example, there isn't
a description of 'any-string! that identifies all operations on
(methods for?) that class (and inherited by its subclasses).  Hmmm...

Then I tried understanding the "superclasses" as being more analogous
to "interfaces" (as in, e.g., Java or [shudder] VB).  In other words,
'any-block! would not be a literal type (which could be instantiated)
but simply a concept describing the common capabilities/roles of
'block!, 'list!, 'hash!, and 'paren!.  However, that doesn't work, as
this whole thread was inspired by stateful behavior of a series as a
reference to a block (or string !) that can be manipulated indepen-
dently of the block/string.

Similar confusion attends to the concept of "scoping", BTW.

I hope NOT to be coming across as complaining/flaming/whining, but
rather as raising points which I believe would be profitably
addressed by the documentation/book teams as they tackle the non-
trivial task of helping "furriners lak me" understand this highly
appealing (but sometimes mysterious) language.

The first edition of _Programming_Perl_ (Wall/Schwartz) had a
section called "Common Goofs for Novices", which I found VERY helpful
in building a mental model of Perl.  Later writings included hints
for people coming from c, shell scripting, etc.  I've seen the same
treatment used to introduce Java to programmers familiar with c,
smalltalk, etc.  I think it would be helpful to have some REBOL
concepts described in terms of (or in contrast to) the conventional
ideas from other OO languages.  (And I know it can't happen
overnight...)

-jn-

P.S.  Would you believe that I've even seen a book titled something
like _Java_for_RPG_Programmers_ ?  No kidding!

Reply via email to