blob: 3d8844225ebb2db75211807746852b8ea0ea66cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<head>
<link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../style.css" rel="stylesheet"/>
<title>BQN: Mathematical Double-struck S (𝕊)</title>
</head>
<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">help</a></div>
<h1 id="mathematical-double-struck-s-𝕊"><a class="header" href="#mathematical-double-struck-s-𝕊">Mathematical Double-struck S (<code><span class='Function'>𝕊</span></code>)</a></h1>
<h2 id="𝕊-current-function"><a class="header" href="#𝕊-current-function"><code><span class='Function'>𝕊</span></code>: Current Function</a></h2>
<p><a class="fulldoc" href="../doc/syntax.html#blocks">→full documentation</a></p>
<p>A variable assigned to the current function block. <code><span class='Value'>𝕤</span></code> accesses the same value but has a subject role.</p>
<p><code><span class='Function'>𝕊</span></code> can be used for recursion.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=RiDihpAge/CdlYogMDogMTsg8J2VqSDDlyDwnZWKIPCdlaktMX0gIyBGYWN0b3JpYWwKRiA1Cgp78J2VpOKAv/CdlaR9NA==">↗️</a><pre> <span class='Function'>F</span> <span class='Gets'>←</span> <span class='Brace'>{</span><span class='Function'>𝕊</span> <span class='Number'>0</span><span class='Head'>:</span> <span class='Number'>1</span><span class='Head'>;</span> <span class='Value'>𝕩</span> <span class='Function'>×</span> <span class='Function'>𝕊</span> <span class='Value'>𝕩</span><span class='Function'>-</span><span class='Number'>1</span><span class='Brace'>}</span> <span class='Comment'># Factorial
</span> <span class='Function'>F</span> <span class='Number'>5</span>
120
<span class='Brace'>{</span><span class='Value'>𝕤</span><span class='Ligature'>‿</span><span class='Value'>𝕤</span><span class='Brace'>}</span><span class='Number'>4</span>
⟨ (function block) (function block) ⟩
</pre>
|