From 8d9506d2fe2063d9b5d4604e5d3d7c2b2ce3df56 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 7 Jul 2021 12:38:38 -0400 Subject: =?UTF-8?q?Mention=20=C2=AF1=E2=8A=91=20as=20the=20obvious=20way?= =?UTF-8?q?=20to=20get=20the=20last=20element?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/doc/pick.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/doc') diff --git a/docs/doc/pick.html b/docs/doc/pick.html index 3f5495aa..0926b3a0 100644 --- a/docs/doc/pick.html +++ b/docs/doc/pick.html @@ -64,8 +64,10 @@ ⟨ " " ⟨ 0 0 0 0 ⟩ ⟩

So one way to find the fill element for an array 𝕩 of any shape is 0𝕩.

-

In APL it's common to get the last element of a list with an idiom that translates to ⊑⌽, or First-Reverse. I prefer to use Fold with the Right identity function.

-↗️
    ⊑⌽ "last"
+

In APL it's common to get the last element of a list with an idiom that translates to ⊑⌽, or First-Reverse. In BQN the most straightforward way is to select with index ¯1 instead. I also sometimes use Fold with the Right identity function.

+↗️
    ⊑⌽ "last"
+'t'
+    ¯1 "last"
 't'
     ´ "last"
 't'
-- 
cgit v1.2.3