2.12.1 Rope transpose constructor

Procedure: rope-transpose-from-index rope index

A multi-valued function, the values consisting of a <rope-transpose> pointer to the leaf of rope corresponding to index, and a new index for the position of index inside the leaf itself.

(define r (cons->rope '(("La " . "vie ") .("est " . "ailleurs"))))
(rope-transpose-from-index r 8)
  ⇒ #<<rope-transpose> node: "est " ... >
  ⇒ 1

Example 2.21: Obtaining a <rope-transpose> pointer from a given index.

Notice that the ninth character of the string ‘La vie est ailleurs’ is the second character of the string ‘est ’. Thus the first value of rope-transpose-from-index gives us a <rope-transpose> pointer to the string ‘est ’ and the second value is the local index in that string.