[EMAIL PROTECTED] wrote:
> 
> Based on the above, we can say that
> 1. A series IS a data storage into which we may insert data.
> 2. A series HAS a current position at which the data storage
>    is accessed
>

In THEORY, a series is a data storage and a "current position"
within that storage.

In IMPLEMENTATION, a series has a REFERENCE to a sharable data storage
and has a private/nonshared "current position" within that storage.
Don't we agree that given:

    a: next "123456"
    b: next a

both 'a and 'b refer to the same string, but to different positions
within that string?  Isn't it valid to say that 'a and 'b are not the
same series, but that each is a series referring to the same string
(or whatever we want to call the data storage in this example)?
Isn't that less ambiguous than saying that they are the same series?

>
> 3. Both the data stored by the series as well as the series' current
> position can be controlled by using REBOL functions.
>

Some REBOL operations affect only the current position of a series,
and therefore have no effect on any other series referring to the
same data storage.

Other REBOL operations affect the data storage referred to by a
series, and may therefore cause side-effects on any other series
values which refer to the same data storage.

>
> 3. Modifying the current position does not modify the data.
>

Agreed.  Affecting the current position of a particular series
has no effect on the data storage referred to by that series
because the current position is not part of the data storage,
but belongs to that series alone (whether or not other series
values refer to the same data storage).

>
> 4. When the data is modified, the modifications always begin at the current
> position of the series. (One could complain and refer to 'append, which
> inserts stuff at the tail of a series, and not at its current position. But
> I would refer to append's source, which uses tail to position the series
> immediately behind its last element and then uses insert to insert a value
> at that position. So, append itself modifies the current position of the
> series in order to achieve its purpose. Therefore append proves this point
> and doesn't contradict it.)
> 5. Modifying the data may modify the current position (insert, remove), but
> does not have to (replace) and occassionally does (append).
>

Can we agree to finesse the entire 'append side discussion by simply
saying

    Modifying the data storage referred to by a series takes the
    current position of that series into account, and may change
    that current position.  It will not change the current position
    of any other series referring to the same data storage.

For completeness, I would then add

    However, the change to the shared data storage may render invalid
    the current position of another series referring to the same data
    storage; that fact will not be detected
    [by the current implementation]
    until a subsequent attempt is made to access the data storage
    through a series with a current position which is out of bounds
    relative to the modified data storage.

>
> 6. The current position of a series is local.
> 7. The data of a series is global.
> 

My computing science background endows "local" and "global" with
a fair bit of baggage.  Could we agree on "private/public" or
"sharable/non-sharable"?

-jn-

[Discussion of more of Elan's thoughtful/thoughtprovoking comments
 will follow in due time...;-]

Reply via email to