diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/doc/block.html | 5 | ||||
| -rw-r--r-- | docs/doc/control.html | 12 | ||||
| -rw-r--r-- | docs/doc/syntax.html | 4 | ||||
| -rw-r--r-- | docs/repl.js | 2 |
4 files changed, 2 insertions, 21 deletions
diff --git a/docs/doc/block.html b/docs/doc/block.html index 491fd87d..5e957e1e 100644 --- a/docs/doc/block.html +++ b/docs/doc/block.html @@ -181,7 +181,7 @@ </span><span class='Brace'>{</span> <span class='Modifier'>_đŁ</span><span class='Value'>:</span> <span class='Comment'># 1-Modifier </span><span class='Brace'>{</span> <span class='Modifier2'>_đŁ_</span><span class='Value'>:</span> <span class='Comment'># 2-Modifier </span></pre> -<p>For immediate blocks, this is the only type of header possible, and it must use an identifier as there is no applicable special name. However, this name can't be used, except for <a href="#returns">returns</a>: it doesn't make sense to refer to a value while it is still being computed!</p> +<p>For immediate blocks, this is the only type of header possible, and it must use an identifier as there is no applicable special name. However, the name can't be used: it doesn't make sense to refer to a value while it is still being computed!</p> <h2 id="multiple-bodies"><a class="header" href="#multiple-bodies">Multiple bodies</a></h2> <p>Blocks that define functions and deferred modifiers can include more than one body, separated by semicolons <code><span class='Value'>;</span></code>. The body used for a particular evaluation is chosen based on the arguments the the block. One special case applies when there are exactly two bodies either without headers or with labels only: in this case, the first applies when there is one argument and the second when there are two.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=QW1iaXYg4oaQIHsg4p+oMSzwnZWp4p+pIDsg4p+oMizwnZWoLPCdlanin6kgfQpBbWJpdiAnYScKJ2EnIEFtYml2ICdiJw==">âď¸</a><pre> <span class='Function'>Ambiv</span> <span class='Gets'>â</span> <span class='Brace'>{</span> <span class='Bracket'>â¨</span><span class='Number'>1</span><span class='Separator'>,</span><span class='Value'>đŠ</span><span class='Bracket'>âŠ</span> <span class='Value'>;</span> <span class='Bracket'>â¨</span><span class='Number'>2</span><span class='Separator'>,</span><span class='Value'>đ¨</span><span class='Separator'>,</span><span class='Value'>đŠ</span><span class='Bracket'>âŠ</span> <span class='Brace'>}</span> @@ -242,6 +242,3 @@ ERROR ERROR </pre> <p>This is the main drawback of predicates relative to guards in APL dfns (also written with <code><span class='Value'>?</span></code>), while the advantage is that it allows multiple expressions, or extra conditions, after a <code><span class='Value'>?</span></code>. It's not how I would have designed it if I just wanted to make a syntax for if statements, but it's a natural fit for the header system.</p> -<h2 id="returns"><a class="header" href="#returns">Returns</a></h2> -<p><em>This feature is not yet included in any BQN implementation.</em></p> -<p>The glyph <code><span class='Gets'>â</span></code> indicates an early return from a block. It must be preceded either by one of the self-reference special names <code><span class='Function'>đ</span></code> or <code><span class='Value'>đŁ</span></code> or by an internal name for a containing block. The combination of name and return tokenâlike <code><span class='Function'>F</span><span class='Gets'>â</span></code>, let's sayâis a function that returns from the current instance of the indicated block. If that instance has already returned, then it instead results in an error.</p> diff --git a/docs/doc/control.html b/docs/doc/control.html index 3c3c2f1a..8ffdc5bc 100644 --- a/docs/doc/control.html +++ b/docs/doc/control.html @@ -205,15 +205,3 @@ <span class='Brace'>}</span> <span class='Brace'>}</span><span class='Bracket'>âŠ</span> </pre> -<h3 id="break-and-continue"><a class="header" href="#break-and-continue">Break and continue</a></h3> -<p>In a <code><span class='Function'>While</span></code> or <code><span class='Function'>For</span></code> loop, <a href="block.html#returns">returns</a> can be used for either the break or the continue statement (or, for that matter, a multiline break) if available. Returning from the main body, either with <code><span class='Function'>đ</span><span class='Gets'>â</span></code> or a labelled return, is a functional version of a continue statement. To escape from the loop as a whole, it should be wrapped in a labelled immediate block. Returning from that block using its label breaks the loop. For example, the following loop</p> -<pre><span class='Brace'>{</span><span class='Value'>brk:</span> - <span class='Value'>sum</span> <span class='Gets'>â</span> <span class='Number'>0</span> <span class='Separator'>â</span> <span class='Value'>even</span> <span class='Gets'>â</span> <span class='Bracket'>â¨âŠ</span> - <span class='Function'>While</span> <span class='Brace'>{</span><span class='Value'>đ¤</span><span class='Separator'>â</span><span class='Value'>sum</span><span class='Function'><</span><span class='Number'>100</span><span class='Brace'>}</span><span class='Ligature'>âż</span><span class='Brace'>{</span><span class='Function'>Cnt</span><span class='Value'>:</span> - <span class='Value'>brk</span><span class='Gets'>â</span><span class='Modifier2'>â</span><span class='Paren'>(</span><span class='Number'>15</span><span class='Function'>â¤</span><span class='Value'>n</span><span class='Paren'>)</span> <span class='String'>@</span> - <span class='Value'>sum</span> <span class='Function'>+</span><span class='Gets'>âŠ</span> <span class='Value'>n</span> - <span class='Function'>Cnt</span><span class='Gets'>â</span><span class='Modifier2'>â</span><span class='Paren'>(</span><span class='Number'>2</span><span class='Function'>|</span><span class='Value'>n</span><span class='Paren'>)</span> <span class='String'>@</span> - <span class='Value'>even</span> <span class='Function'>âž</span><span class='Gets'>âŠ</span> <span class='Value'>n</span> - <span class='Brace'>}</span> -<span class='Brace'>}</span> -</pre> diff --git a/docs/doc/syntax.html b/docs/doc/syntax.html index 9d4fbc8e..6bf68ada 100644 --- a/docs/doc/syntax.html +++ b/docs/doc/syntax.html @@ -49,10 +49,6 @@ <td><a href="expression.html#assignment">Change</a></td> </tr> <tr> -<td><code><span class='Gets'>â</span></code></td> -<td><a href="block.html#returns">Return</a></td> -</tr> -<tr> <td><code><span class='Separator'>â,</span></code> or newline</td> <td>Statement or element <a href="#separators">separator</a></td> </tr> diff --git a/docs/repl.js b/docs/repl.js index 52217e50..7180ec53 100644 --- a/docs/repl.js +++ b/docs/repl.js @@ -113,7 +113,7 @@ let typeChar = (t, c, ev) => { } let syncls={ v:"Value", f:"Function", m:"Modifier", d:"Modifier2", n:"Number", g:"Gets", p:"Paren", b:"Bracket", k:"Brace", l:"Ligature", n:"Nothing", s:"Separator", c:"Comment", a:"String" }; -let keydesc='f+Conjugate;Add_f-Negate;Subtract_fĂSign;Multiply_fáReciprocal;Divide_fâExponential;Power_fâSquare Root;Root_fâFloor;Minimum_fâCeiling;Maximum_fâ§Sort Up;And_fâ¨Sort Down;Or_fÂŹNot;Span_f|Absolute Value;Modulus_fâ¤Less Than or Equal to_f<Enclose;Less Than_f>Merge;Greater Than_fâĽGreater Than or Equal to_f=Rank;Equals_fâ Length;Not Equals_fâĄDepth;Match_fâ˘Shape;Not Match_fâŁIdentity;Left_fâ˘Identity;Right_fâĽDeshape;Reshape_fâžJoin;Join to_fâSolo;Couple_fâEnlist;Pair_fâPrefixes;Take_fâSuffixes;Drop_fâRange;Windows_fÂŤShift Before_fÂťShift After_fâ˝Reverse;Rotate_fâTranspose;Reorder axes_f/Indices;Replicate_fâGrade Up;Bins Up_fâGrade Down;Bins Down_fâFirst Cell;Select_fâFirst;Pick_fâClassify;Index of_fâOccurrence Count;Progressive Index of_fâMark First;Member of_fâˇDeduplicate;Find_fâGroup Indices;Group_f!Assert;Assert with message_mËConstant_mËSelf/Swap_dâAtop_dâOver_dâ¸Before/Bind_dâAfter/Bind_dâžUnder_dâValences_dâśChoose_dâCatch_dâRank_mËCells_dâDepth_m¨Each_mâTable_dâRepeat_mâźUndo_m´Fold_mËInsert_m`Scan_gâDefine_gâExport_gâŠChange_gâReturn_sâSeparator_s,Separator_v.Namespace field_p(Begin expression_p)End expression_k{Begin block_k}End block_bâ¨Begin list_bâŠEnd list_lâżStrand_n¡Nothing_vâ˘System_vđ¨Left argument_fđLeft argument (as function)_vđŠRight argument_fđRight argument (as function)_vđModifier left operand (as subject)_fđ˝Modifier left operand_vđ2-modifier right operand (as subject)_fđž2-modifier right operand_vđ¤Current function (as subject)_fđCurrent function_mđŁCurrent modifier_nÂŻMinus_nĎPi_nâInfinity_a@Null character_c#Comment'.split(/[\n_]/); +let keydesc='f+Conjugate;Add_f-Negate;Subtract_fĂSign;Multiply_fáReciprocal;Divide_fâExponential;Power_fâSquare Root;Root_fâFloor;Minimum_fâCeiling;Maximum_fâ§Sort Up;And_fâ¨Sort Down;Or_fÂŹNot;Span_f|Absolute Value;Modulus_fâ¤Less Than or Equal to_f<Enclose;Less Than_f>Merge;Greater Than_fâĽGreater Than or Equal to_f=Rank;Equals_fâ Length;Not Equals_fâĄDepth;Match_fâ˘Shape;Not Match_fâŁIdentity;Left_fâ˘Identity;Right_fâĽDeshape;Reshape_fâžJoin;Join to_fâSolo;Couple_fâEnlist;Pair_fâPrefixes;Take_fâSuffixes;Drop_fâRange;Windows_fÂŤShift Before_fÂťShift After_fâ˝Reverse;Rotate_fâTranspose;Reorder axes_f/Indices;Replicate_fâGrade Up;Bins Up_fâGrade Down;Bins Down_fâFirst Cell;Select_fâFirst;Pick_fâClassify;Index of_fâOccurrence Count;Progressive Index of_fâMark First;Member of_fâˇDeduplicate;Find_fâGroup Indices;Group_f!Assert;Assert with message_mËConstant_mËSelf/Swap_dâAtop_dâOver_dâ¸Before/Bind_dâAfter/Bind_dâžUnder_dâValences_dâśChoose_dâCatch_dâRank_mËCells_dâDepth_m¨Each_mâTable_dâRepeat_mâźUndo_m´Fold_mËInsert_m`Scan_gâDefine_gâExport_gâŠChange_sâSeparator_s,Separator_v.Namespace field_p(Begin expression_p)End expression_k{Begin block_k}End block_bâ¨Begin list_bâŠEnd list_lâżStrand_n¡Nothing_vâ˘System_vđ¨Left argument_fđLeft argument (as function)_vđŠRight argument_fđRight argument (as function)_vđModifier left operand (as subject)_fđ˝Modifier left operand_vđ2-modifier right operand (as subject)_fđž2-modifier right operand_vđ¤Current function (as subject)_fđCurrent function_mđŁCurrent modifier_nÂŻMinus_nĎPi_nâInfinity_a@Null character_c#Comment'.split(/[\n_]/); let kk=Array.from('`123456890-=~!@#$%^&*()_+qwertuiop[]QWERTIOP{}asdfghjkl;ASFGHKL:"zxcvbm,./ZXVBM<>? \''); let kv=Array.from('Ë˨âźâ´ËâÂŻâ˘ĂˇĂÂŹââââśâââââ¨âŠâââ˝đ¨âââ§âââĎâââđâˇđŁââââłâŁâ˘âđ¤âđđâ¸âââââđđ˝đžÂŤâžÂťÂˇËâĽđŠââ¨ââĄâžââ âđâââ˘â¤âĽââżâŠ'); let keys={}, revkeys={}, primhelp={}; |
