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


2.12.1 Rope transpose constructor

Procedure: rope-transpose-from-index rope index

A multi-value function 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 first of the string ‘est ’: the first value of rope-transpose-from-index gives us a <rope-transpose> pointer to the string and the second value is the local index in that string.