Next: , Previous: , Up: rope API   [Contents][Index]


2.8 Insertions and deletions

Procedure: rope-insert-at rope insertor index

Inserts insertor in rope at index. The index is between ‘0’ and the length of rope (inclusively). The result is rebalanced if necessary.

(rope->string (rope-insert-at "GNUGuile" " " 3))
  ⇒ "GNU Guile"

(let ((r1 (string->random-rope "My name is: !!")))
     ((r2 (string->random-rope "GNU Guile")))
  (rope->string (rope-insert-at r1 r2 12)))
  ⇒ "My name is: GNU Guile!!"

Example 2.9: Inserting in a rope.

Procedure: rope-delete rope start end

Remove the portion of the rope from start (inclusive) to end (exclusive). The result is rebalanced if necessary.