From 558804cbb1a365c3fae4c97b56e6603fe93cf028 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 14 Oct 2021 17:00:28 -0400 Subject: Remove indications that BQN might add tolerant comparison; it won't --- docs/commentary/problems.html | 20 ++------------------ docs/doc/match.html | 4 ++-- 2 files changed, 4 insertions(+), 20 deletions(-) (limited to 'docs') diff --git a/docs/commentary/problems.html b/docs/commentary/problems.html index 16bbcac4..e2feae77 100644 --- a/docs/commentary/problems.html +++ b/docs/commentary/problems.html @@ -32,24 +32,6 @@

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.

-

Comparison tolerance

-

Kind of necessary for practical programming, but how should it be invoked or controlled? A system variable like CT? Per-primitive control? Both? Which primitives should use it?

- - - - - - - - - - - - - - - -
DefinitelyMaybeDefinitely not
=≠≤≥<>≡≢⊐⊒∊⍷|⍋⍒

No access to fast high-precision sum

Fold has a specific order of application, which must be used for +`. But other orders can be both faster and more precise (in typical cases) by enabling greater parallelism. Generally ties into the question of providing precision control for a program: it could be fixed by a flag that enables BQN to optimize as long as the results will be at least as precise (relative to the same program in infinite precision) as the spec.

High-rank array notation

@@ -65,6 +47,8 @@

In Choose, the selector goes on the left; in Repeat, the count goes on the right. Could be a strength in some contexts, since you can change Repeat-as-If to Choose if you don't like the ordering, but maybe a language that forces the programmer to make semantic decisions for syntactic reasons is not providing the greatest of services.

Group doesn't include trailing empty groups

A length can now be specified either in an extra element in any rank-1 component of 𝕨, or by overtaking, since the result's fill element is an empty group. However, it still seems like it would be pretty easy to end up with a length error when a program using Group encounters unexpected data. It's a fundamental safety-convenience tradeoff, though, because specifying a length has to take more code in the general case.

+

Tolerant comparison

+

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+⌽.

Glyphs that aren't great

diff --git a/docs/doc/match.html b/docs/doc/match.html index b162bd3b..1e73afb8 100644 --- a/docs/doc/match.html +++ b/docs/doc/match.html @@ -30,7 +30,7 @@ ↗️
    'a', +, 3 = -», '+', 3˙
 ⟨ 0 0 0 ⟩
 
-

Two characters are equal when they have the same code point. Numeric equality depends on the number system in use, but probably works about how you expect. If you're coming from APL, note that current BQN implementations don't employ comparison tolerance. To see if two floats are roughly equal you'll need to write a tolerant comparison yourself, but how often do you really need to do this?

+

Two characters are equal when they have the same code point. Numeric equality depends on the number system in use, but probably works about how you expect. If you're coming from APL, note that BQN doesn't use comparison tolerance. To see if two floats are roughly equal you'll need to write a tolerant comparison yourself, but how often do you really need to do this?

↗️
    'x' = "wxyz"
 ⟨ 0 1 0 0 ⟩
 
@@ -57,7 +57,7 @@
 

Block equality

The final point above about block instances is subtler. An instance of a block function or modifier is mutable, meaning that its behavior can change over the course of a program. Consider the following two functions:

↗️
    FG  { a10  {a+𝕩}{a𝕩} }
-⟨ *function* *function* ⟩
+⟨ (function block) (function block) ⟩
 
     F 5   # One result
 15
-- 
cgit v1.2.3