From 776bdd6ec954a123b22df1f4de06bdd6c3edd18c Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 5 Feb 2022 18:00:29 -0500 Subject: Doing TAO comparisons gets easier with Enlist --- commentary/problems.md | 6 +++--- docs/commentary/problems.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commentary/problems.md b/commentary/problems.md index 4167ba27..e7a09450 100644 --- a/commentary/problems.md +++ b/commentary/problems.md @@ -38,9 +38,6 @@ This includes index-of-last, and searching starting at a particular index, when ### Subtraction, division, and span are backwards The left argument feels much more like the primary one in these cases (indeed, this matches the typical left-to-right ordering of binary operators in mathematics). The commonly-paired `⌊∘÷` and `|` have opposite orders for this reason. Not really fixable; too much precedent. -### Can't access array ordering directly -Only `⍋⍒` use array ordering rather than just array equality or numeric ordering. Getting at the actual ordering to just compare two arrays is more difficult than it should be (but not *that* difficult: `⥊⊸⍋⌾<` is TAO `≤`). - ### Nothing (`·`) interacts strangely with Before and After Since `𝕨F⊸G𝕩` is `(F𝕨)G𝕩` and `𝕨F⟜G𝕩` is `𝕨F G𝕩` in the dyadic case, we might expect these to devolve to `G𝕩` and `F G𝕩` when `𝕨` is not present. Not so: instead `𝕩` is substituted for the missing `𝕨`. And Before and After are also the main places where a programmer might try to use `𝕨` as an operand, which doesn't work either (the right way is the train `𝕨F⊢`). It's also a little strange that `v F˜·` is `·`, while `·F v` is `F v`. @@ -73,6 +70,9 @@ APL has it and BQN doesn't; after some experience it seems this causes few probl ### Index Of privileges the first match It could be more sound to look at all matches, but using just the first one is too convenient. J has an index-of-last function; in BQN you have to reverse the left argument and then do arithmetic: `≠∘⊣-1+⌽⊸⊐`. +### Can't access array ordering directly +Only `⍋⍒` use array ordering rather than just array equality or numeric ordering. Getting at the actual ordering to just compare two arrays is not hard but also not obvious: `⍋⌾⋈` is TAO `≤`. + ### Glyphs that aren't great Blanket issue for unintuitive glyphs. Currently I find `⥊⊏⊑⊐⊒⍷⁼⎉⚇` to not be particularly good fits for what they describe. diff --git a/docs/commentary/problems.html b/docs/commentary/problems.html index 4199ddaa..f444638a 100644 --- a/docs/commentary/problems.html +++ b/docs/commentary/problems.html @@ -28,8 +28,6 @@

This includes index-of-last, and searching starting at a particular index, when the desired result indices are to the array to be seached before it is modified. Given indices i into an array 𝕨 (for example ⌽↕≠𝕨 or a+↕b), this section can be searched with (i∾≠𝕨)˜(i𝕨)𝕩. But this is clunky and difficult for the implementation to optimize.

Subtraction, division, and span are backwards

The left argument feels much more like the primary one in these cases (indeed, this matches the typical left-to-right ordering of binary operators in mathematics). The commonly-paired ÷ and | have opposite orders for this reason. Not really fixable; too much precedent.

-

Can't access array ordering directly

-

Only ⍋⍒ use array ordering rather than just array equality or numeric ordering. Getting at the actual ordering to just compare two arrays is more difficult than it should be (but not that difficult: < is TAO ).

Nothing (·) interacts strangely with Before and After

Since 𝕨FG𝕩 is (F𝕨)G𝕩 and 𝕨FG𝕩 is 𝕨F G𝕩 in the dyadic case, we might expect these to devolve to G𝕩 and F G𝕩 when 𝕨 is not present. Not so: instead 𝕩 is substituted for the missing 𝕨. And Before and After are also the main places where a programmer might try to use 𝕨 as an operand, which doesn't work either (the right way is the train 𝕨F⊢). It's also a little strange that v F˜· is ·, while ·F v is F v.

No access to fast high-precision sum

@@ -51,6 +49,8 @@

APL has it and BQN doesn't; after some experience it seems this causes few problems, and the extra effort required for the algorithms that do need it is negligible (anyway, it's better to be aware when your code relies on imprecise equality). APL and J also tolerate inexact indices and lengths, which is also something that could be supported.

Index Of privileges the first match

It could be more sound to look at all matches, but using just the first one is too convenient. J has an index-of-last function; in BQN you have to reverse the left argument and then do arithmetic: ⊣-1+⌽.

+

Can't access array ordering directly

+

Only ⍋⍒ use array ordering rather than just array equality or numeric ordering. Getting at the actual ordering to just compare two arrays is not hard but also not obvious: is TAO .

Glyphs that aren't great

Blanket issue for unintuitive glyphs. Currently I find ⥊⊏⊑⊐⊒⍷⎉⚇ to not be particularly good fits for what they describe.

Can't mix define and modify in multiple assignment

-- cgit v1.2.3