From 44ed8888851bce05cf2aa181ed258e0a550499d0 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 26 Dec 2020 21:39:37 -0500 Subject: =?UTF-8?q?Mention=20=E2=8C=BE(<=CB=98)=20for=20reshaping=20first?= =?UTF-8?q?=20axis=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/commentary/problems.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/commentary/problems.html') diff --git a/docs/commentary/problems.html b/docs/commentary/problems.html index f74aabde..fbdd6eb5 100644 --- a/docs/commentary/problems.html +++ b/docs/commentary/problems.html @@ -81,7 +81,7 @@

Prefixes/Suffixes add depth and Windows doesn't

It's an awkward inconsistency. Prefixes and Suffixes have to have a nested result, but Windows doesn't have to be flat; it's just that making it nested ignores the fact that it does have an array structure.

Deshape and Reshape can't ignore trailing axes

-

If you want to repeat 3 major cells until there are 7 of them, or combine the first 4 axes of a rank-6 array, what's your best option? Nothing's too good: you could compute a full shape for Reshape, enclose cells and merge afterwards, use Select to reshape one axis to multiple, or use ˝ to merge two axes (with possible empty-array issues). This is particularly dangerous with computed-length reshapes like 2, since the idea of splitting off a length-2 axis from an array's first axis is generally useful, but this version has an implicit Deshape first. J's Reshape analogue ($) only ever applies to the first axis. This also seems to be giving up a lot.

+

If you want to repeat 3 major cells until there are 7 of them, or combine the first 4 axes of a rank-6 array, what's your best option? Nothing's too good: you could compute a full shape for Reshape, enclose cells and merge afterwards (for example 7(<˘)), use Select to reshape one axis to multiple, or use ˝ to merge two axes (with possible empty-array issues). This is particularly dangerous with computed-length reshapes like 2, since the idea of splitting off a length-2 axis from an array's first axis is generally useful, but this version has an implicit Deshape first. J's Reshape analogue ($) only ever applies to the first axis. This also seems to be giving up a lot.

At which scope does a block function belong?

As a general principle, a programmer should make choices in one part of a program that constrain other parts of the program most tightly. This is a weak principle, but often it doesn't conflict with any other preferences and can be followed for free. For example it's usually best to define a variable in the smallest possible scope, so the reader knows it isn't used outside that scope. The same principle applies to blocks, but there is another conflicting principle: placing the block in a broader scope guarantees it won't access the variables in narrower ones. There's no position that will tell the reader, for example, that a function only uses variables local to itself and that it's only used within one particular scope.

This is an issue with any lexically-scoped language; it's unlikely BQN can solve it. On the other hand, I'm surprised I've never seen any discussion of such a universal issue.

-- cgit v1.2.3