From 1d6a9cf1441bd6d478977715d82031e77c20ce5c Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 26 Oct 2020 15:46:38 -0400 Subject: Don't include &run in documentation REPL links: it's no longer used --- docs/doc/based.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/based.html') diff --git a/docs/doc/based.html b/docs/doc/based.html index c0021093..e070bb94 100644 --- a/docs/doc/based.html +++ b/docs/doc/based.html @@ -12,7 +12,7 @@

APL tends to define its data by starting with the array and then looking downwards in depth at what it contains. The based array model, as the name suggests, starts at the foundations, which in BQN are called "atoms". There are five types of atom, which together with the array type give the six types a value can have in BQN. Based means being yourself, and an atom's not an array.

An atom has depth 0, and doesn't inherently have a shape. However, primitives that expect an array promote atoms by enclosing them to get a rank-0, or unit, array that contains the atom (any value can be enclosed in this way, giving a unit array with higher depth, but it only happens automatically for atoms). Rank and shape both do this, so an atom can be considered to have the same dimensions as a unit array: rank 0 and shape ⟨⟩. An atom is also considered a kind of unit, but it's not a unit array.

Atoms are displayed as plain values, while enclosed atoms, that is, depth-1 unit arrays, are shown with an array display.

-↗️
    3    # Atom
+↗️
    3    # Atom
 3
     <3   # Array
 ┌·   
@@ -22,18 +22,18 @@
 '3'
 

In addition to numbers and characters, functions, 1-modifiers, and 2-modifiers are atoms. We can see this by converting one to a subject role and checking its depth.

-↗️
    Plus  +
+↗️
    Plus  +
      plus
 0
 

The primitives that return a single number, like Rank (=), Length (), and Match (), give it as an atom, not an array.

-↗️
     "abc"
+↗️
     "abc"
 1
       "abc"  # The result was an atom
 0
 

Transposing no axes of an array wouldn't do anything. But because Transpose expects its right argument to be an array, it converts an atom to an array.

-↗️
    ⟨⟩  3
+↗️
    ⟨⟩  3
 ┌·   
 · 3  
     ┘
-- 
cgit v1.2.3