Skip to content

Commit

Permalink
Docs generated from: feat: Adds Dynamic.sort & improves output of fai…
Browse files Browse the repository at this point in the history
…ling dynamic tests (#1411)

* feat: Adds Dynamic.sort

* test: Adds tests for Dynamic.sort

* refactor: Makes dynamic test handler display diff

of expected vs actual instead of displaying "true" : "true"

* test: Removes complex implementation of list-equal-unordered

Replaces it with sort + equal. While this is less "correct", having
complex untested functions within test files is undesirable. This
implementation is "good enough" for lists of integers.
  • Loading branch information
carp-lang committed Apr 9, 2022
1 parent 19b2d63 commit 935301f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions core/Dynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -3457,6 +3457,31 @@ <h3 id="set-env">
<p>sets an environment variable.</p>
<p>Example Usage:</p>
<pre><code>(set-env &quot;CARP_WAS_HERE&quot; &quot;true&quot;)
</code></pre>

</p>
</div>
<div class="binder">
<a class="anchor" href="#sort">
<h3 id="sort">
sort
</h3>
</a>
<div class="description">
dynamic
</div>
<p class="sig">
Dynamic
</p>
<pre class="args">
(sort l compare)
</pre>
<p class="doc">
<p>Sorts a list using the provided predicate. It is not a stable sort.
Example:</p>
<pre><code>(sort '(1 3 4 2 5 4) &lt;) ; =&gt; (1 2 3 4 4 5)
(sort '(1 3 4 2 5 4) &gt;) ; =&gt; (5 4 4 3 2 1)
(sort '(&quot;one&quot; &quot;two---&quot; &quot;three&quot; &quot;four&quot;) (fn [a b] (&lt; (String.length a) (String.length b)))) ; =&gt; (&quot;one&quot; &quot;four&quot; &quot;three&quot; &quot;two---&quot;)
</code></pre>

</p>
Expand Down

0 comments on commit 935301f

Please sign in to comment.