diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-15 15:01:22 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-15 15:01:22 -0400 |
| commit | e858f41dffaee272ffcf4b2cb63a49ad25ebf7d7 (patch) | |
| tree | 25b625f3b0561702db034495dd2ee1d84f6ec8ef /docs/doc/based.html | |
| parent | 2d094f01f7421a56259433c4b0e86a5f92ba0871 (diff) | |
Highlight namespace dot as a separate token in md.bqn
Diffstat (limited to 'docs/doc/based.html')
| -rw-r--r-- | docs/doc/based.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/based.html b/docs/doc/based.html index ced213c8..36ce2af8 100644 --- a/docs/doc/based.html +++ b/docs/doc/based.html @@ -48,4 +48,4 @@ <h2 id="versus-the-boxed-array-model">Versus the boxed array model</h2> <p>The <a href="https://aplwiki.com/wiki/Array_model#Boxes">boxed array model</a> of SHARP APL, A+, and J is an inductive system like BQN's. But this model uses arrays as the base case: numeric and character arrays are the simplest kind of data allowed, and "a number" means a rank-0 numeric array. The inductive step is the array of boxes; as with numbers "a box" is simply a rank-0 array of boxes.</p> <p>Numeric and character arrays in this system have depth 0. In general these correspond to arrays of depth 1 in BQN, but because there's no lower depth they are also used where BQN atoms would appear. For example, both Shape (<code><span class='Value'>$</span></code>) and Length (<code><span class='Comment'>#</span></code>) return depth-0 results in J. For an array <code><span class='Value'>a</span></code> with rank at least 1, the length <code><span class='Comment'>#a</span></code> is exactly <code><span class='Value'>[</span><span class='Function'>/</span> <span class='Value'>$</span> <span class='Value'>a</span></code>, while the identical BQN code <code><span class='Function'>⊣</span><span class='Modifier'>˝</span> <span class='Function'>≢</span> <span class='Value'>a</span></code> returns not <code><span class='Function'>≠</span> <span class='Value'>a</span></code> but <code><span class='Function'><</span> <span class='Function'>≠</span> <span class='Value'>a</span></code>. Like the nested model, the boxed model can hide depth issues that occur at lower depths but generally reveals them at higher depths.</p> -<p>The boundary at depth 0 will tend to cause inconsistencies and confusion in any array language, and boxed array languages push this boundary up a level. This leads to the programmer spending more effort managing boxes: for example, to reverse each list in a list of lists, the programmer can use reverse under open, <code><span class='Function'>|</span><span class='Number'>.</span> <span class='Value'>&</span><span class='Number'>.</span> <span class='Function'>></span></code>. But to find the lengths of each of these lists, <code><span class='Comment'># &. ></span></code> would yield a boxed list, which is usually not wanted, so <code><span class='Comment'># @ ></span></code> is needed instead. BQN shows that a system that doesn't require these distinctions is possible, as a BQN programmer would use <code><span class='Function'>⌽</span><span class='Modifier'>¨</span></code> and <code><span class='Function'>≠</span><span class='Modifier'>¨</span></code>.</p> +<p>The boundary at depth 0 will tend to cause inconsistencies and confusion in any array language, and boxed array languages push this boundary up a level. This leads to the programmer spending more effort managing boxes: for example, to reverse each list in a list of lists, the programmer can use reverse under open, <code><span class='Function'>|</span><span class='Value'>.</span> <span class='Value'>&.</span> <span class='Function'>></span></code>. But to find the lengths of each of these lists, <code><span class='Comment'># &. ></span></code> would yield a boxed list, which is usually not wanted, so <code><span class='Comment'># @ ></span></code> is needed instead. BQN shows that a system that doesn't require these distinctions is possible, as a BQN programmer would use <code><span class='Function'>⌽</span><span class='Modifier'>¨</span></code> and <code><span class='Function'>≠</span><span class='Modifier'>¨</span></code>.</p> |
