Liking cljdoc? Tell your friends :D

ordered-collections.types.string-rope

Persistent string rope optimized for structural text editing. Backed by a chunked weight-balanced tree with String chunks. O(log n) concat, split, splice, insert, and remove. Implements CharSequence for seamless Java interop.

Small strings (≤ +flat-threshold+ chars) are stored as a raw String internally, giving String-equivalent performance on read operations. When edits grow the content past the threshold, the representation is transparently promoted to the chunked tree form.

Persistent string rope optimized for structural text editing.
Backed by a chunked weight-balanced tree with String chunks.
O(log n) concat, split, splice, insert, and remove.
Implements CharSequence for seamless Java interop.

Small strings (≤ +flat-threshold+ chars) are stored as a raw String
internally, giving String-equivalent performance on read operations.
When edits grow the content past the threshold, the representation
is transparently promoted to the chunked tree form.
raw docstring

read-string-ropeclj

(read-string-rope s)

Reader function for #string/rope tagged literals.

Reader function for #string/rope tagged literals.
sourceraw docstring

string-ropeclj

(string-rope)
(string-rope s)

Create a persistent string rope for structural text editing. Backed by a chunked weight-balanced tree: O(log n) concat, split, splice, insert, and remove. Competitive at all sizes, dominant at scale.

Small strings (≤ 1024 chars) are stored in flat String representation for zero-overhead reads. Edits that grow past the threshold are transparently promoted to the chunked tree form.

Implements CharSequence for seamless Java interop.

Examples: (string-rope) ;=> #string/rope "" (string-rope "hello world") ;=> #string/rope "hello world" (string-rope (slurp "big-file.txt")) ;=> efficient chunked representation

Create a persistent string rope for structural text editing.
Backed by a chunked weight-balanced tree: O(log n) concat, split,
splice, insert, and remove. Competitive at all sizes, dominant at scale.

Small strings (≤ 1024 chars) are stored in flat String representation
for zero-overhead reads. Edits that grow past the threshold are
transparently promoted to the chunked tree form.

Implements CharSequence for seamless Java interop.

Examples:
  (string-rope)                        ;=> #string/rope ""
  (string-rope "hello world")          ;=> #string/rope "hello world"
  (string-rope (slurp "big-file.txt")) ;=> efficient chunked representation
sourceraw docstring

string-rope-concatclj

(string-rope-concat x)
(string-rope-concat left right)
(string-rope-concat left right & more)

Concatenate string ropes or strings. One argument: returns it as a string rope. Two arguments: O(log n) binary tree join. Three or more: O(total chunks) bulk construction.

Concatenate string ropes or strings.
One argument: returns it as a string rope.
Two arguments: O(log n) binary tree join.
Three or more: O(total chunks) bulk construction.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close