Here's what append does:

>> ? append
Appends a value to the tail of a series and returns the series head.
Arguments:
    series --  (series port)
    value --
Refinements:
    /only -- Appends a block value into a block series as a block
>>

"Returns the series head" means 'Returns the series positioned at its head'

After the append, if you look at b, you'll see only what you appended, as
you expect.

Look at this:

>> b: make block! [" Hello"]
== [" Hello"]
>> b: next b
== []
>> append b "Russell"
== [" Hello" "Russell"]
>> b
== ["Russell"]
>> append b "jr"
== [" Hello" "Russell" "jr"]
>> b
== ["Russell" "jr"]

Looks fine to me, ie, not strange!

Russell [EMAIL PROTECTED]
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 20, 2000 7:36 AM
Subject: [REBOL] strange append behavior


> Howdy...
>
> I ran this interactively:
>
> b: make block! ["hello"]
> length? b
> b: next b
> length? b
> append b "Why do I see the first string?"
>
>
> And got this:
>
> >> b: make block! ["hello"]
> == ["hello"]
> >> length? b
> == 1
> >> b: next b
> == []
> >> length? b
> == 0
> >> append b "Why do I see the first string?"
> == ["hello" "Why do I see the first string?"]
> >>
>
>
>
> -ridley
>
>
>

Reply via email to