Hi Keith,
there are two fucntions, insert and append. You quote from the dictionary,
I cant' access it right now, but I think it should say something similar to
what REBOL reports when request help for insert:
Inserts a value into a series and returns the series after the insert.
Arguments:
series -- Series at point to insert (series port bitset)
[snip]
The important notion here series -- Series at point to insert.
When you insert into the head of the series
>text: "is now"
>insert text "the "
then the inserted string will indeed be at the head of the string, because
that is the point of insertion.
You can insert at the end of the string using insert:
insert tail text " the"
or you can use append, which in turn uses tail on your behalf:
>> source append
append: func [
{Appends a value to the tail of a series and returns the series head.}
series [series! port!]
value
/only {Appends a block value into a block series as a block}
][
head either only [insert/only tail series :value
] [
insert tail series :value
]
]
Hope this helps,
Elan
At 05:52 PM 12/6/99 -0500, you wrote:
>Hi, I'm not sure if insert works how it's supposed to.
>
>This is from the dictionary:
>
>If the value is a series compatible with the first (block or string-based
>datatype), then all of its values will be inserted. The series position just
>past the insert is returned, allowing multiple inserts to be cascaded
>together.
>
>I would think that if I said:
>
>text: "is now"
>insert text "the "
>insert text "time "
>text: head text
>
>I should get "the time is now" but I get "time the is now"
>
>Shouldn't it insert the "the " at the beginning, but then leave me "just
>past the insert" so that if I say insert again it inserts it after the "the
>"? This is what I would think it meant by cascading inserts together. If you
>say:
>
>duh: ""
>insert duh "The "
>insert duh "time "
>insert duh "is "
>insert duh "now. "
>duh: head duh
>
>I would expect to get "The time is now.", but I get "now. is time The ".
>
>What do you think?
>
>Keith
>
>
>