> The position past the insert is returned, but INSERT does not change the
"cursor" of the original variable.

Awesome, this was the main thing I was trying to understand. Like, if you
do:

>> i: "a"
== "a"
>> insert i "b"
== "a"
>> insert i "c"
== "ba"
>> i
== "cba"

it seems confusing. On the one hand, right after you do an insert, it
returns the series at the point right after what you inserted, but the
variable that points to the series itself is left at the beginning of what
you insert. I finally understand why you can chain inserts together like
this:

>> insert insert i "D" "E"
== "cba"
>> i
== "DEcba"

and have it come out "in order".

The only questions I have left are:

Why does the original series still point to the beginning of what you
inserted? Because of this there is no way to do two inserts separately and
have the second insert appear after the first in the series. I guess this
makes sense. It sort of pushes what you inserted forward in the series and
leaves you where you were.

The other question I have is... because of this behavior, is there any way
to do an insert after another insert and have what you inserted second come
out after what you inserted first? Is there any way to say:

h: "pokey"
insertafter h "the "
insertafter h "hokey "

and have h be "the hokey pokey"

in other words, is there any function that will leave the cursor for the
series after what you inserted?

Or, to put it yet another way, is there any way to sort of "append" at
anywhere but the end of the series and then leave the cursor at the end of
what it appended? This is sort of what I've been trying to accomplish: an
append in the middle of the series.

Thanks to everyone for their help.

Keith

Reply via email to