Skip to content

Commit

Permalink
Docs generated from: feat: allow for multibranches in case (#1276)
Browse files Browse the repository at this point in the history
  • Loading branch information
carp-lang committed Jul 8, 2021
1 parent 8ddb43a commit e30ff9d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/Globals in ControlMacros.carp.html
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,14 @@ <h3 id="case">
</pre>
<p class="doc">
<p>takes a form and a list of branches which are value and operation
pairs. If a value matches, the operation is executed. It takes a catch-all else
branch that is executed if nothing matches.</p>
pairs. If a value matches (or any in a list of values preced by <code>:or</code>), the
operation is executed. It takes a catch-all else branch that is executed if
nothing matches.</p>
<p>Example:</p>
<pre><code>(case (+ 10 1)
10 (println* &quot;nope&quot;)
11 (println* &quot;yup&quot;)
(:or 12 13) (println* &quot;multibranch, but nope&quot;)
(println* &quot;else branch&quot;)
)
</code></pre>
Expand Down

0 comments on commit e30ff9d

Please sign in to comment.