|
|
@ -84,7 +84,7 @@ String module compatible API.</p> |
|
|
|
<ul class="summary"> |
|
|
|
<li> |
|
|
|
<span class="summary_signature"> |
|
|
|
<a href="#concat/1">concat/1</a> |
|
|
|
<a href="#balanced?/1">balanced?/1</a> |
|
|
|
</span> |
|
|
|
</li> |
|
|
|
<li> |
|
|
@ -159,42 +159,35 @@ String module compatible API.</p> |
|
|
|
<div id="functions_details" class="details_list"> |
|
|
|
<h2>Functions</h2> |
|
|
|
<div class="detail"> |
|
|
|
<p class="signature" id="concat/1"> |
|
|
|
<strong>concat(list1)</strong> |
|
|
|
<p class="signature" id="balanced?/1"> |
|
|
|
<strong>balanced?(rope)</strong> |
|
|
|
</p> |
|
|
|
<div class="docstring"><p>Concatenates the list of ropes or strings together into a single new rope. </p> |
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
<pre><code>iex> Rope.concat(["Time is", " an illusion."]) |> Rope.to_binary |
|
|
|
"Time is an illusion." |
|
|
|
|
|
|
|
iex> Rope.concat([Rope.new("terrible"), " ghastly", " silence"]) |> Rope.to_binary |
|
|
|
"terrible ghastly silence" |
|
|
|
</code></pre> |
|
|
|
<div class="docstring"><p>Checks if the rope is considered balanced based on comparing total length |
|
|
|
and depth verses the fibanocci sequence.</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L128" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L164" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
|
<p class="signature" id="concat/2"> |
|
|
|
<strong>concat(rope, rope)</strong> |
|
|
|
<strong>concat(list1, opts // [])</strong> |
|
|
|
</p> |
|
|
|
<div class="docstring"><p>Concatenates two ropes together producing a new single rope. Accepts |
|
|
|
ropes or strings as arguments.</p> |
|
|
|
<div class="docstring"><p>Concatenates the list of ropes or strings together into a single new rope. |
|
|
|
Accepts ropes or strings as arguments. Additionally you can override the |
|
|
|
auto-rebalancing behavior with a <code>rebalance: false</code> option.</p> |
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
<pre><code>iex> Rope.concat("Time is", " an illusion.") |> Rope.to_binary |
|
|
|
<pre><code>iex> Rope.concat(["Time is", " an illusion."]) |> Rope.to_binary |
|
|
|
"Time is an illusion." |
|
|
|
|
|
|
|
iex> Rope.concat(Rope.new("terrible"), " ghastly silence") |> Rope.to_binary |
|
|
|
iex> Rope.concat([Rope.new("terrible"), " ghastly", " silence"]) |> Rope.to_binary |
|
|
|
"terrible ghastly silence" |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L89" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L95" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -209,7 +202,7 @@ rebalance.</p> |
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
<pre><code>iex> Rope.depth(Rope.concat(Rope.new("terrible"), " ghastly silence")) |
|
|
|
<pre><code>iex> Rope.depth(Rope.concat([Rope.new("terrible"), " ghastly silence"])) |
|
|
|
1 |
|
|
|
|
|
|
|
iex> Rope.depth(Rope.concat([Rope.new("terrible"), " ghastly", " silence"])) |
|
|
@ -217,7 +210,7 @@ iex> Rope.depth(Rope.concat([Rope.new("terrible"), " ghastly&q |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L243" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L227" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -236,7 +229,7 @@ iex> Rope.find(Rope.concat(["loathe it", " or ignore it," |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L320" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L304" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -257,7 +250,7 @@ iex> Rope.find_all(Rope.concat(["loathe it", " or ignore it,&q |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L358" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L355" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -277,7 +270,7 @@ iex> Rope.insert_at(Rope.concat(["infinite ", "number ", |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L264" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L248" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -288,12 +281,12 @@ iex> Rope.insert_at(Rope.concat(["infinite ", "number ", |
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
|
<pre><code>iex> Rope.length(Rope.concat(Rope.new("terrible"), " ghastly silence")) |
|
|
|
<pre><code>iex> Rope.length(Rope.concat([Rope.new("terrible"), " ghastly silence"])) |
|
|
|
24 |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L218" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L202" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -301,7 +294,7 @@ iex> Rope.insert_at(Rope.concat(["infinite ", "number ", |
|
|
|
<strong>new(str)</strong> |
|
|
|
</p> |
|
|
|
<div class="docstring"><p>Creates a new rope with the string provided. Not needed since |
|
|
|
concat/2 supports strings and ropes as arguments.</p> |
|
|
|
<a href="#concat/2"><code>concat/2</code></a> supports strings and ropes as arguments.</p> |
|
|
|
|
|
|
|
<h2>Examples</h2> |
|
|
|
|
|
|
@ -310,7 +303,7 @@ concat/2 supports strings and ropes as arguments.</p> |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L68" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L73" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -322,7 +315,7 @@ efficient. This is a pretty greedy rebalancing and should produce |
|
|
|
a fully balanced rope.</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L197" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L181" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -343,7 +336,7 @@ iex> Rope.remove_at(Rope.concat(["infinite ", "number of " |
|
|
|
</code></pre> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L293" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L277" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -356,7 +349,7 @@ By default, it replaces all entries, except if the global option |
|
|
|
is set to false.</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L369" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L390" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -369,7 +362,7 @@ the second. If the offset is greater than string length, than it returns nil.</p |
|
|
|
<p>Similar to String.slice/3, check the tests for some examples of usage.</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L143" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L111" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="detail"> |
|
|
@ -379,7 +372,7 @@ the second. If the offset is greater than string length, than it returns nil.</p |
|
|
|
<div class="docstring"><p>Converts the entire rope to a single binary.</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L383" target="_blank" class="view_source">Source</a> |
|
|
|
<a href="https://github.com/copenhas/ropex/blob/master/lib/rope.ex#L404" target="_blank" class="view_source">Source</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|