diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-23 16:53:49 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-23 16:54:14 -0400 |
| commit | 1c18950453d3b4281c921fdb79f80fe4bec6ec3e (patch) | |
| tree | 4bfded33525090e6f800ac0eaf16f580c4833d20 | |
| parent | 72bf97658b8dd6f167908a8452116c86a950ff4b (diff) | |
Add [] to keybar and help
| -rw-r--r-- | docs/help/beginarray.html | 20 | ||||
| -rw-r--r-- | docs/help/endarray.html | 19 | ||||
| -rw-r--r-- | docs/repl.js | 2 | ||||
| -rw-r--r-- | help/README.md | 2 | ||||
| -rw-r--r-- | help/beginarray.md | 14 | ||||
| -rw-r--r-- | help/endarray.md | 12 | ||||
| -rwxr-xr-x | help/genhelp.bqn | 2 |
7 files changed, 69 insertions, 2 deletions
diff --git a/docs/help/beginarray.html b/docs/help/beginarray.html new file mode 100644 index 00000000..07abccdf --- /dev/null +++ b/docs/help/beginarray.html @@ -0,0 +1,20 @@ +<head> + <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/> + <link href="../style.css" rel="stylesheet"/> + <title>BQN: Left Square Bracket ([)</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="left-square-bracket-"><a class="header" href="#left-square-bracket-">Left Square Bracket (<code><span class='Bracket'>[</span></code>)</a></h1> +<h2 id="--begin-array"><a class="header" href="#--begin-array"><code><span class='Bracket'>[</span> <span class='Value'>...</span></code>: Begin array</a></h2> +<p><a class="fulldoc" href="../doc/arrayrepr.html#high-rank-arrays">→full documentation</a></p> +<p>Starts a high-rank array. Entries must be separated by <code><span class='Separator'>,</span></code> or <code><span class='Separator'>⋄</span></code>. These must have the same shape. They become major cells of the result.</p> +<p>Must end with a corresponding <code><span class='Bracket'>]</span></code>.</p> +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=WyJhYmMiLCAiZGVmIl0KClvihpU0LCDihpU1XQ==">↗️</a><pre> <span class='Bracket'>[</span><span class='String'>"abc"</span><span class='Separator'>,</span> <span class='String'>"def"</span><span class='Bracket'>]</span> +┌─ +╵"abc + def" + ┘ + + <span class='Bracket'>[</span><span class='Function'>↕</span><span class='Number'>4</span><span class='Separator'>,</span> <span class='Function'>↕</span><span class='Number'>5</span><span class='Bracket'>]</span> +<span class='Error'>Error: >: Elements didn't have equal shapes (contained shapes ⟨4⟩ and ⟨5⟩)</span> +</pre> diff --git a/docs/help/endarray.html b/docs/help/endarray.html new file mode 100644 index 00000000..44ccc07a --- /dev/null +++ b/docs/help/endarray.html @@ -0,0 +1,19 @@ +<head> + <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/> + <link href="../style.css" rel="stylesheet"/> + <title>BQN: Right Square Bracket (])</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="right-square-bracket-"><a class="header" href="#right-square-bracket-">Right Square Bracket (<code><span class='Bracket'>]</span></code>)</a></h1> +<h2 id="--end-array"><a class="header" href="#--end-array"><code><span class='Value'>...</span> <span class='Bracket'>]</span></code>: End array</a></h2> +<p><a class="fulldoc" href="../doc/arrayrepr.html#high-rank-arrays">→full documentation</a></p> +<p>Ends an array started by a <code><span class='Bracket'>[</span></code>. See <a href="beginarray.html">Begin Array</a> for more details.</p> +<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=WyJhYmMiLCAiZGVmIl0KClvihpU0LCDihpU1XQ==">↗️</a><pre> <span class='Bracket'>[</span><span class='String'>"abc"</span><span class='Separator'>,</span> <span class='String'>"def"</span><span class='Bracket'>]</span> +┌─ +╵"abc + def" + ┘ + + <span class='Bracket'>[</span><span class='Function'>↕</span><span class='Number'>4</span><span class='Separator'>,</span> <span class='Function'>↕</span><span class='Number'>5</span><span class='Bracket'>]</span> +<span class='Error'>Error: >: Elements didn't have equal shapes (contained shapes ⟨4⟩ and ⟨5⟩)</span> +</pre> diff --git a/docs/repl.js b/docs/repl.js index 4ff8db0b..f6182591 100644 --- a/docs/repl.js +++ b/docs/repl.js @@ -159,7 +159,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", h:"Head", 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_s⋄Separator_s,Separator_v.Namespace field_p(Begin expression_p)End expression_k{Begin block_k}End block_h;Next body_h:Header_h?Predicate_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_a\'Character_a\"String_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_h;Next body_h:Header_h?Predicate_b⟨Begin list_b⟩End list_b[Begin array_b]End array_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_a\'Character_a\"String_c#Comment'.split(/[\n_]/); let kk=Array.from('`123456890-=~!@#$%^&*()_+qwertuiop[]QWERTIOP{}asdfghjkl;ASFGHKL:"zxcvbm,./ZXVBM<>? \''); let kv=Array.from('˜˘¨⁼⌜´˝∞¯•÷׬⎉⚇⍟◶⊘⎊⍎⍕⟨⟩√⋆⌽𝕨∊↑∧⊔⊏⊐π←→↙𝕎⍷𝕣⍋⊑⊒⍳⊣⊢⍉𝕤↕𝕗𝕘⊸∘○⟜⋄↖𝕊𝔽𝔾«⌾»·˙⥊𝕩↓∨⌊≡∾≍≠⋈𝕏⍒⌈≢≤≥⇐‿↩'); let keys={}, revkeys={}, primhelp={}, helpurl={}; diff --git a/help/README.md b/help/README.md index 6e074c95..d7b0b3ae 100644 --- a/help/README.md +++ b/help/README.md @@ -82,6 +82,8 @@ | `?` | [Predicate](predicate.md) | | `⟨` | [Begin list](beginlist.md) | | `⟩` | [End list](endlist.md) | +| `[` | [Begin array](beginarray.md) | +| `]` | [End array](endarray.md) | | `‿` | [Strand](strand.md) | | `·` | [Nothing](nothing.md) | | `•` | [System](system.md) | diff --git a/help/beginarray.md b/help/beginarray.md new file mode 100644 index 00000000..a8e64c33 --- /dev/null +++ b/help/beginarray.md @@ -0,0 +1,14 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/beginarray.html).* + +# Left Square Bracket (`[`) + +## `[ ...`: Begin array +[→full documentation](../doc/arrayrepr.md#high-rank-arrays) + +Starts a high-rank array. Entries must be separated by `,` or `⋄`. These must have the same shape. They become major cells of the result. + +Must end with a corresponding `]`. + + ["abc", "def"] + + [↕4, ↕5] diff --git a/help/endarray.md b/help/endarray.md new file mode 100644 index 00000000..797837da --- /dev/null +++ b/help/endarray.md @@ -0,0 +1,12 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/endarray.html).* + +# Right Square Bracket (`]`) + +## `... ]`: End array +[→full documentation](../doc/arrayrepr.md#high-rank-arrays) + +Ends an array started by a `[`. See [Begin Array](beginarray.md) for more details. + + ["abc", "def"] + + [↕4, ↕5] diff --git a/help/genhelp.bqn b/help/genhelp.bqn index 20cb66e8..5b11366b 100755 --- a/help/genhelp.bqn +++ b/help/genhelp.bqn @@ -1,7 +1,7 @@ #!/usr/bin/env bqn files ← "README.md"⊸≢¨⊸/ (⍋(¬∊⟜"_.")⊸/¨)⊸⊏ ".md"⊸(-∘≠⊸↑≡⊣)¨⊸/ •file.List "" -gl ← "+-×÷⋆√⌊⌈∧∨¬|≤<>≥=≠≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜∘○⊸⟜⌾⊘◶⎊⎉˘⚇¨⌜⍟⁼´˝`←⇐↩⋄,.(){};:?⟨⟩‿·•𝕨𝕎𝕩𝕏𝕗𝔽𝕘𝔾𝕤𝕊𝕣¯π∞@#" +gl ← "+-×÷⋆√⌊⌈∧∨¬|≤<>≥=≠≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜∘○⊸⟜⌾⊘◶⎊⎉˘⚇¨⌜⍟⁼´˝`←⇐↩⋄,.(){};:?⟨⟩[]‿·•𝕨𝕎𝕩𝕏𝕗𝔽𝕘𝔾𝕤𝕊𝕣¯π∞@#" rows ← (⍋gl⊸⊐)⊸⊏˝⍉> { data ← •FLines 𝕩 |
