From 18054b581d332cc9142cdd0ff1c9bec38d92aef5 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 3 Sep 2022 08:02:35 -0400 Subject: Swapped + for - --- commentary/why.md | 2 +- docs/commentary/why.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commentary/why.md b/commentary/why.md index 03ef81fd..69f5c6c6 100644 --- a/commentary/why.md +++ b/commentary/why.md @@ -134,6 +134,6 @@ It gets worse. │0│1│2│ └─┴─┴─┘ -This should not be possible. `f` here doesn't behave like `+`, or quite like `|.`: in fact there is no function that does what `f` does. The result of `f` depends on the entire argument, but `<@f` encloses rank 0 components! How long would it take you to debug an issue like this? It's rare, but I've run into it in my own code and seen similar reports on the forums. +This should not be possible. `f` here doesn't behave like `-`, or quite like `|.`: in fact there is no function that does what `f` does. The result of `f` depends on the entire argument, but `<@f` encloses rank 0 components! How long would it take you to debug an issue like this? It's rare, but I've run into it in my own code and seen similar reports on the forums. The cause is that the value of `f` here—a named `g` function—is not just a name, but also comes with a function rank. The function rank is set by the assignment `f =: g`, and doesn't change along with `g`. Calling `f` doesn't rely on the rank, but `@` does, so `<@f` effectively becomes `<@|."-`, mixing the two versions of `g`. The only explanation I have for this one is implementation convenience. diff --git a/docs/commentary/why.html b/docs/commentary/why.html index 1fe07371..669f1b34 100644 --- a/docs/commentary/why.html +++ b/docs/commentary/why.html @@ -95,5 +95,5 @@ 012 └─┴─┴─┘ -

This should not be possible. f here doesn't behave like +, or quite like |.: in fact there is no function that does what f does. The result of f depends on the entire argument, but <@f encloses rank 0 components! How long would it take you to debug an issue like this? It's rare, but I've run into it in my own code and seen similar reports on the forums.

+

This should not be possible. f here doesn't behave like -, or quite like |.: in fact there is no function that does what f does. The result of f depends on the entire argument, but <@f encloses rank 0 components! How long would it take you to debug an issue like this? It's rare, but I've run into it in my own code and seen similar reports on the forums.

The cause is that the value of f here—a named g function—is not just a name, but also comes with a function rank. The function rank is set by the assignment f =: g, and doesn't change along with g. Calling f doesn't rely on the rank, but @ does, so <@f effectively becomes <@|."-, mixing the two versions of g. The only explanation I have for this one is implementation convenience.

-- cgit v1.2.3