Did you know ... Search Documentation:
Pack ropes -- prolog/ropes.pl
PublicShow source

An implementation of the rope data structure.

Based on Boehm, H.J., Russ Atkinson, and Michael Plass. "Ropes: An alternative to strings." Software: Practice and Experience 25.12 (1995): 1315-1330.

 string_rope(+String:string, -Rope:rope) is det
True when Rope is a rope leaf holding the string String
 rope_string(+Rope:rope, -String:string) is det
True when Rope represents the accumulated string String
 rope_codes(+Rope:rope, -Codes:codes) is det
True when Rope represents the accumulated list of codes in Codes
 rope_split(+Rope:rope, +At:nonneg, -Left:rope, -Right:rope) is det
True when spliting Rope at underlying offset At yields ropes Left and Right
 rope_concat(+Left:rope, +Right:rope, -Rope:rope) is det
True when Rope is the concatenation of Left and Right
 rope_report(+Rope:rope, +Offset:integer, +Length:integer, -String:string) is det
True when String is unified with the sub string in offset Offset and length Length of the underlying string of rope Rope
 rope_edit(+RopeIn:rope, +Offset:integer, +Length:integer, +Content:string, -RopeOut:rope) is det
Unify RopeOut with a rope obtained by replacing Content with the portion of RopeIn starting from offset Offset and spanning Length characters.