Elan,
While you're on INSERT vs APPEND... what about with ports (I just happened
to ask myself this question today)?
In various programs I've seen people use both... opening a port, then
talking through it using either append or insert. I've done both and they
seem to work. Is there a rule/reason why/when you'd use one vs. the other?
Is one more "proper"? Do they both appear to work the same simply because
the data moves out of the port buffer so quickly, leaving it empty by next use?
Thanks,
Russ
----
At 03:56 PM 12/6/1999 -0800, you wrote:
>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