From 97dd08aab03affeb0bed8508f25d7a04f2a92d67 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 29 Jul 2020 18:33:13 -0400 Subject: Use result generation in main README --- docs/index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'docs/index.html') diff --git a/docs/index.html b/docs/index.html index 21590b89..9a783767 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,8 +26,9 @@

It's three letters, that happen to match the capitals in "Big Questions Notation". You can pronounce it "bacon", but are advised to avoid this unless there's puns.

What does BQN look like?

Rather strange, most likely:

-
⊑+`122  # The 12th Fibonacci number
-
+
    ⊑+`122  # The 12th Fibonacci number
+144
+

For longer samples, you can gaze into the abyss that is the (incomplete) self-hosted compiler, or take a look at the friendlier markdown processor used to format and highlight documentation files. There are also some translations from "A History of APL in 50 Functions" here.

Array model

Most of BQN's functionality deals with the manipulation of multidimensional arrays. However, it discards many of the complications of traditional APL array models. Unlike in APL, non-array data is possible, and common: numbers, characters, and functions are not arrays (see the full list of types below). This avoids some difficulties that show up when trying to treat scalar arrays as the fundamental unit; in particular, there is no "floating" so a value is always different from a scalar array that contains it. This system has been proposed in APL's past under the name based array theory.

@@ -45,10 +46,10 @@

These roles work exactly like they do in APL, with functions applying to one or two subject arguments, 1-modifiers taking a single function or subject on the left, and 2-modifiers taking a function or subject on each side.

Unlike APL, in BQN the syntactic role of a value is determined purely by the way it's spelled: a lowercase first letter (name) makes it a subject, an uppercase first letter (Name) makes it a function, and underscores are used for 1-modifiers (_name) and 2-modifiers (_name_). Below, the function {𝕎𝕩} treats its left argument 𝕎 as a function and its right argument 𝕩 as a subject. With a list of functions, we can make a table of the square and square root of a few numbers:

    ט, {𝕎𝕩} 149
-
-  1 16 81
-  1  2  3
-          
+┌─         
+╵ 1 16 81  
+  1  2  3  
+          ┘
 

BQN's built-in operations also have patterns to indicate the syntactic role: 1-modifiers (˜¨˘⁼⌜´`) are all superscript characters, and 2-modifiers (∘○⊸⟜⌾⊘◶⚇⎉⍟) all have an unbroken circle (two functions ⌽⍉ have broken circles with lines through them). Every other built-in constant is a function, although the special symbols ¯, , and π are used as part of numeric literal notation.

Special syntax

-- cgit v1.2.3