The description in core.ops is a little terse. How about this:

------------------

 Set $1 to the portion of $2 starting at (zero-based) character position
 $3 and having length $4.

 Optionally pass in string $5 for replacement. If the length of $5 is
 different from the length specified in $4, then $2 will grow or shrink
 accordingly. If $3 is one character position larger than the length of
 $2, then $5 is appended to $2 (and the empty string is returned);
 this is essentially the same as

   concat $2, $5

 Finally, if $3 is negative, then it is taken to count backwards from
 the end of the string (ie an offset of -1 corresponds to the last
 character).


--------------------

 (I can send it as a patch on top of your core.ops patch if you'd prefer).

 Simon


Reply via email to