From f3d45a1ca914d59968531a6d5c409d80b73e53c3 Mon Sep 17 00:00:00 2001 From: razetime Date: Thu, 20 Jan 2022 11:57:50 +0530 Subject: complete REPL help for symbols --- docs/help/2-modifierrightoperand.html | 12 ++++ docs/help/assert_assertwithmessage.html | 2 +- docs/help/beginblock.html | 32 ++++++++++ docs/help/beginexpression.html | 16 +++++ docs/help/beginlist.html | 17 +++++ docs/help/change.html | 19 ++++++ docs/help/comment.html | 16 +++++ docs/help/currentfunction.html | 17 +++++ docs/help/currentmodifier.html | 12 ++++ docs/help/define.html | 22 +++++++ docs/help/endblock.html | 24 +++++++ docs/help/endexpression.html | 15 +++++ docs/help/endlist.html | 15 +++++ docs/help/export.html | 23 +++++++ docs/help/field.html | 15 +++++ docs/help/index.html | 107 +++++++++++++++++++++++++++++++- docs/help/infinity.html | 18 ++++++ docs/help/leftargument.html | 12 ++++ docs/help/minus.html | 16 +++++ docs/help/modifierleftoperand.html | 12 ++++ docs/help/modifierrightoperand.html | 12 ++++ docs/help/nothing.html | 23 +++++++ docs/help/nullcharacter.html | 19 ++++++ docs/help/pi.html | 15 +++++ docs/help/rightargument.html | 12 ++++ docs/help/separator.html | 21 +++++++ docs/help/separator1.html | 21 +++++++ docs/help/strand.html | 16 +++++ docs/help/system.html | 10 +++ docs/repl.js | 2 +- help/2-modifierrightoperand.md | 9 +++ help/README.md | 30 ++++++++- help/assert_assertwithmessage.md | 2 +- help/beginblock.md | 25 ++++++++ help/beginexpression.md | 13 ++++ help/beginlist.md | 16 +++++ help/change.md | 15 +++++ help/comment.md | 14 +++++ help/currentfunction.md | 14 +++++ help/currentmodifier.md | 10 +++ help/define.md | 15 +++++ help/endblock.md | 17 +++++ help/endexpression.md | 12 ++++ help/endlist.md | 14 +++++ help/export.md | 19 ++++++ help/field.md | 11 ++++ help/genhelp.bqn | 8 ++- help/infinity.md | 14 +++++ help/leftargument.md | 9 +++ help/minus.md | 14 +++++ help/modifierleftoperand.md | 9 +++ help/nothing.md | 23 +++++++ help/nullcharacter.md | 16 +++++ help/pi.md | 12 ++++ help/rightargument.md | 9 +++ help/separator.md | 15 +++++ help/separator1.md | 15 +++++ help/strand.md | 16 +++++ help/system.md | 9 +++ 59 files changed, 970 insertions(+), 8 deletions(-) create mode 100644 docs/help/2-modifierrightoperand.html create mode 100644 docs/help/beginblock.html create mode 100644 docs/help/beginexpression.html create mode 100644 docs/help/beginlist.html create mode 100644 docs/help/change.html create mode 100644 docs/help/comment.html create mode 100644 docs/help/currentfunction.html create mode 100644 docs/help/currentmodifier.html create mode 100644 docs/help/define.html create mode 100644 docs/help/endblock.html create mode 100644 docs/help/endexpression.html create mode 100644 docs/help/endlist.html create mode 100644 docs/help/export.html create mode 100644 docs/help/field.html create mode 100644 docs/help/infinity.html create mode 100644 docs/help/leftargument.html create mode 100644 docs/help/minus.html create mode 100644 docs/help/modifierleftoperand.html create mode 100644 docs/help/modifierrightoperand.html create mode 100644 docs/help/nothing.html create mode 100644 docs/help/nullcharacter.html create mode 100644 docs/help/pi.html create mode 100644 docs/help/rightargument.html create mode 100644 docs/help/separator.html create mode 100644 docs/help/separator1.html create mode 100644 docs/help/strand.html create mode 100644 docs/help/system.html create mode 100644 help/2-modifierrightoperand.md create mode 100644 help/beginblock.md create mode 100644 help/beginexpression.md create mode 100644 help/beginlist.md create mode 100644 help/change.md create mode 100644 help/comment.md create mode 100644 help/currentfunction.md create mode 100644 help/currentmodifier.md create mode 100644 help/define.md create mode 100644 help/endblock.md create mode 100644 help/endexpression.md create mode 100644 help/endlist.md create mode 100644 help/export.md create mode 100644 help/field.md create mode 100644 help/infinity.md create mode 100644 help/leftargument.md create mode 100644 help/minus.md create mode 100644 help/modifierleftoperand.md create mode 100644 help/nothing.md create mode 100644 help/nullcharacter.md create mode 100644 help/pi.md create mode 100644 help/rightargument.md create mode 100644 help/separator.md create mode 100644 help/separator1.md create mode 100644 help/strand.md create mode 100644 help/system.md diff --git a/docs/help/2-modifierrightoperand.html b/docs/help/2-modifierrightoperand.html new file mode 100644 index 00000000..d8f02b07 --- /dev/null +++ b/docs/help/2-modifierrightoperand.html @@ -0,0 +1,12 @@ + + + + BQN: Mathematical Double-struck G (`𝔾`) + + +

Mathematical Double-struck G (𝔾)

+

𝔾: 2-Modifier Right operand

+

A variable assigned to the right operand of a 2-modifier block. π•˜ can be used to access the right operand as a value.

+↗️
    5 +{π•˜}3 1
+3
+
diff --git a/docs/help/assert_assertwithmessage.html b/docs/help/assert_assertwithmessage.html index e172ecbd..ec3e9e16 100644 --- a/docs/help/assert_assertwithmessage.html +++ b/docs/help/assert_assertwithmessage.html @@ -16,7 +16,7 @@ ! "hello" Error: hello -

𝕨 ! 𝕩: Dyad

+

𝕨 ! 𝕩: Assert With Message

Throw an error with message 𝕨 if 𝕩 is not 1.

↗️
       "hi" ! 1
 1
diff --git a/docs/help/beginblock.html b/docs/help/beginblock.html
new file mode 100644
index 00000000..af1f3d4b
--- /dev/null
+++ b/docs/help/beginblock.html
@@ -0,0 +1,32 @@
+
+  
+  
+  BQN: Left Curly Bracket (`{`)
+
+
+

Left Curly Bracket ({)

+

{ ...: Begin Block

+

Starts a block, which can be one of:

+ +

Must end with a corresponding }.

+↗️
    {𝕨 + 𝕩}   # Function
+(function block)
+
+    {𝕨‿𝔽‿𝕩}   # 1-modifier
+(1-modifier block)
+
+    {𝕨‿𝔽‿𝔾‿𝕩} # 2-modifier
+(2-modifier block)
+
+    {a ⇐ 5}   # Namespace
+{a⇐}
+
+    {5+4+6}   # Immediate block
+15
+
diff --git a/docs/help/beginexpression.html b/docs/help/beginexpression.html new file mode 100644 index 00000000..1e33e206 --- /dev/null +++ b/docs/help/beginexpression.html @@ -0,0 +1,16 @@ + + + + BQN: Left Parenthesis (`(`) + + +

Left Parenthesis (()

+

( ...: Begin Expression

+

Starts an expression, and only one expression. Must end with a corresponding ).

+

( gives higher precedence to the expression in it, and BQN will evaluate expressions in () first.

+↗️
    1 + 2 - 3
+0
+
+    (1 + 2) - 3
+0
+
diff --git a/docs/help/beginlist.html b/docs/help/beginlist.html new file mode 100644 index 00000000..5fc90b43 --- /dev/null +++ b/docs/help/beginlist.html @@ -0,0 +1,17 @@ + + + + BQN: Mathematical Left Angle Bracket (`⟨`) + + +

Mathematical Left Angle Bracket (⟨)

+

⟨ ...: Begin list

+

Starts a list. Inner elements must be separated by , or β‹„. +Lists can be nested in other lists.

+

Must end with a corresponding ⟩.

+↗️
    ⟨1, 2, 3⟩
+⟨ 1 2 3 ⟩
+
+    ⟨+ β‹„ - β‹„ 56⟩
+⟨ + - 56 ⟩
+
diff --git a/docs/help/change.html b/docs/help/change.html new file mode 100644 index 00000000..147ea5db --- /dev/null +++ b/docs/help/change.html @@ -0,0 +1,19 @@ + + + + BQN: Leftwards Arrow With Hook (`←`) + + +

Leftwards Arrow With Hook (←)

+

n ↩ v: Change

+

Changes the value of variable with name n to value v.

+

Variable n must already exist.

+↗️
    a ↩ 1
+Error: Undefined identifier
+
+    ⊒ b ← 3
+3
+
+    ⊒ b ↩ "Be the change you wish to see in the world."
+"Be the change you wish to see in the world."
+
diff --git a/docs/help/comment.html b/docs/help/comment.html new file mode 100644 index 00000000..d35ee10e --- /dev/null +++ b/docs/help/comment.html @@ -0,0 +1,16 @@ + + + + BQN: Number Sign (`#`) + + +

Number Sign (#)

+

#: Comment

+

Create a comment that extends till the end of a line.

+

Anything written in comments is ignored.

+↗️
    1 + 2 # + 3 + 4
+3
+
+    "Hello world!" # this is ignored!
+"Hello world!"
+
diff --git a/docs/help/currentfunction.html b/docs/help/currentfunction.html new file mode 100644 index 00000000..dd0ac5b0 --- /dev/null +++ b/docs/help/currentfunction.html @@ -0,0 +1,17 @@ + + + + BQN: Mathematical Double-struck S (`π•Š`) + + +

Mathematical Double-struck S (π•Š)

+

π•Š: Current Function

+

A variable assigned to the current function block. 𝕀 can be used to access the current function block as a value.

+

π•Š can be used for recursion.

+↗️
    F ← {π•Š 0: 1; 𝕩 Γ— π•Š 𝕩-1} # Factorial
+    F 5
+120
+
+    {𝕀‿𝕀}4
+⟨ (function block) (function block) ⟩
+
diff --git a/docs/help/currentmodifier.html b/docs/help/currentmodifier.html new file mode 100644 index 00000000..e1481382 --- /dev/null +++ b/docs/help/currentmodifier.html @@ -0,0 +1,12 @@ + + + + BQN: Mathematical Double-struck R (`𝕣`) + + +

Mathematical Double-struck R (𝕣)

+

𝕣: Current Modifier

+

A variable assigned to the current modifier block. Underscores must be added to the beginning and/or end (_𝕣, _𝕣_) to use the modifier with the correct role.

+↗️
    +{π•£βŠ£π•©} 4        
+(1-modifier block)
+
diff --git a/docs/help/define.html b/docs/help/define.html new file mode 100644 index 00000000..d5399cd1 --- /dev/null +++ b/docs/help/define.html @@ -0,0 +1,22 @@ + + + + BQN: Leftwards Arrow (`←`) + + +

Leftwards Arrow (←)

+

n ← v: Define

+

Defines a new variable with name n and value v.

+

Variable n must not already exist.

+↗️
    ⊒ a ← 1
+1
+
+    ⊒ b ← 3β€Ώ3 β₯Š 5
+β”Œβ”€       
+β•΅ 5 5 5  
+  5 5 5  
+  5 5 5  
+        β”˜
+
+    C ← ↑
+
diff --git a/docs/help/endblock.html b/docs/help/endblock.html new file mode 100644 index 00000000..5cac2a7c --- /dev/null +++ b/docs/help/endblock.html @@ -0,0 +1,24 @@ + + + + BQN: Right Curly Bracket (`}`) + + +

Right Curly Bracket (})

+

... }: End Block

+

Starts a block, which starts with }. See Begin Block for more details.

+↗️
    {𝕨 + 𝕩}   # Function
+(function block)
+
+    {𝕨‿𝔽‿𝕩}   # 1-modifier
+(1-modifier block)
+
+    {𝕨‿𝔽‿𝔾‿𝕩} # 2-modifier
+(2-modifier block)
+
+    {a ⇐ 5}   # Namespace
+{a⇐}
+
+    {5+4+6}   # Immediate block
+15
+
diff --git a/docs/help/endexpression.html b/docs/help/endexpression.html new file mode 100644 index 00000000..e180ae85 --- /dev/null +++ b/docs/help/endexpression.html @@ -0,0 +1,15 @@ + + + + BQN: Right Parenthesis (`)`) + + +

Right Parenthesis ())

+

... ): End Expression

+

The closing symbol for (. See Begin Expression for more details.

+↗️
    1 + 2 - 3
+0
+
+    (1 + 2) - 3
+0
+
diff --git a/docs/help/endlist.html b/docs/help/endlist.html new file mode 100644 index 00000000..633509f1 --- /dev/null +++ b/docs/help/endlist.html @@ -0,0 +1,15 @@ + + + + BQN: Mathematical Right Angle Bracket (`⟩`) + + +

Mathematical Right Angle Bracket (⟩)

+

... ⟩: End list

+

Ends a list started by a ⟨. See Begin List for more details.

+↗️
    ⟨1, 2, 3⟩
+⟨ 1 2 3 ⟩
+
+    ⟨+ β‹„ - β‹„ 56⟩
+⟨ + - 56 ⟩
+
diff --git a/docs/help/export.html b/docs/help/export.html new file mode 100644 index 00000000..dced1f53 --- /dev/null +++ b/docs/help/export.html @@ -0,0 +1,23 @@ + + + + BQN: Leftward Double Arrow (`⇐`) + + +

Leftward Double Arrow (⇐)

+

n ⇐ v: Export Definition

+

Define a variable with name n and export it from the current namespace or program's scope.

+↗️
    ns ← { exported ⇐ 5, unexported ← 0}
+    ns.exported
+5
+    ns.unexported
+Error: No key found
+
+

𝕨 ⇐: Export names

+

Export the names given in 𝕩 from the current namespace or program's scope. Names must be defined.

+↗️
    ns1 ← { ⟨alsoexportedβŸ©β‡, exported ⇐ 5, alsoexported ← 0}
+    ns1.exported
+5
+    ns1.alsoexported
+0
+
diff --git a/docs/help/field.html b/docs/help/field.html new file mode 100644 index 00000000..2de58500 --- /dev/null +++ b/docs/help/field.html @@ -0,0 +1,15 @@ + + + + BQN: Full Stop (`.`) + + +

Full Stop (.)

+

ns . name: Namespace Field

+

Access a field with name name in namespace ns. Field must have been exported with ⇐.

+↗️
    {a⇐1} . a
+1
+
+    {F⇐-}.F 5
+Β―5
+
diff --git a/docs/help/index.html b/docs/help/index.html index 12b1abc2..a47d3eda 100644 --- a/docs/help/index.html +++ b/docs/help/index.html @@ -5,6 +5,7 @@

REPL Help

+

Symbols are listed in alphabetical order of page name, ignoring syntactical roles.

@@ -14,6 +15,10 @@ + + + + @@ -23,7 +28,7 @@ - + @@ -34,6 +39,18 @@ + + + + + + + + + + + + @@ -46,6 +63,10 @@ + + + + @@ -54,6 +75,10 @@ + + + + @@ -62,10 +87,22 @@ + + + + + + + + + + + + @@ -86,6 +123,18 @@ + + + + + + + + + + + + @@ -94,6 +143,14 @@ + + + + + + + + @@ -138,6 +195,10 @@ + + + + @@ -146,6 +207,10 @@ + + + + @@ -162,14 +227,30 @@ + + + + + + + + + + + + + + + + @@ -178,6 +259,10 @@ + + + + @@ -206,6 +291,10 @@ + + + + @@ -214,6 +303,14 @@ + + + + + + + + @@ -246,10 +343,18 @@ + + + + + + + + diff --git a/docs/help/infinity.html b/docs/help/infinity.html new file mode 100644 index 00000000..c74c6f53 --- /dev/null +++ b/docs/help/infinity.html @@ -0,0 +1,18 @@ + + + + BQN: Infinity (`∞`) + + +

Infinity (∞)

+

∞: Infinity

+

Mathematical constant Infinity. Shares the same status as other numbers, can be negative (¯∞).

+↗️
    ∞
+∞
+
+    ¯∞
+¯∞
+
+    1+∞
+∞
+
diff --git a/docs/help/leftargument.html b/docs/help/leftargument.html new file mode 100644 index 00000000..f1718e21 --- /dev/null +++ b/docs/help/leftargument.html @@ -0,0 +1,12 @@ + + + + BQN: Mathematical Double-struck W (`𝕨`) + + +

Mathematical Double-struck W (𝕨)

+

𝕨: Left Argument

+

A variable assigned to the left argument of a block. π•Ž can be used to access the left argument as a function.

+↗️
    5 {𝕨} 1
+5
+
diff --git a/docs/help/minus.html b/docs/help/minus.html new file mode 100644 index 00000000..965be169 --- /dev/null +++ b/docs/help/minus.html @@ -0,0 +1,16 @@ + + + + BQN: Macron (`Β―`) + + +

Macron (Β―)

+

Β―: Minus

+

Prefix before numbers to indicate that they are negative.

+

Note that this is not the same as -, since it is part of the number, rather than a primitive that negates its value.

+↗️
    -1β€Ώ2β€Ώ3
+⟨ ¯1 ¯2 ¯3 ⟩
+
+    Β―1β€Ώ2β€Ώ3
+⟨ ¯1 2 3 ⟩
+
diff --git a/docs/help/modifierleftoperand.html b/docs/help/modifierleftoperand.html new file mode 100644 index 00000000..71392719 --- /dev/null +++ b/docs/help/modifierleftoperand.html @@ -0,0 +1,12 @@ + + + + BQN: Mathematical Double-struck F (`𝔽`) + + +

Mathematical Double-struck F (𝔽)

+

𝔽: Modifier Left operand

+

A variable assigned to the left operand of a modifier block. 𝕗 can be used to access the left operand as a value.

+↗️
    5 +{π•—βŠ£π•¨} 1
++
+
diff --git a/docs/help/modifierrightoperand.html b/docs/help/modifierrightoperand.html new file mode 100644 index 00000000..b8e5462d --- /dev/null +++ b/docs/help/modifierrightoperand.html @@ -0,0 +1,12 @@ + + + + BQN: Mathematical Double-struck G (`𝔾`) + + +

Mathematical Double-struck G (𝔾)

+

𝔾: Right operand

+

A variable assigned to the right operand of a modifier block. π•˜ can be used to access the right operand as a value.

+↗️
    5 +{π•˜}3 1
+3
+
diff --git a/docs/help/nothing.html b/docs/help/nothing.html new file mode 100644 index 00000000..53a04340 --- /dev/null +++ b/docs/help/nothing.html @@ -0,0 +1,23 @@ + + + + BQN: Middle Dot (`Β·`) + + +

Middle Dot (Β·)

+

Β·: Nothing

+

In Trains

+

Nothing can serve as a left argument in a train to string together multiple monadic functions.

+↗️
    (-+-) 5
+Β―10
+
+    (-Β·+-) 5
+5
+
+

In Block Headers

+

For Block header pattern matching syntax, Nothing can be used to indicate an unused value.

+↗️
    F ← {π•Š aβ€ΏΒ·β€Ώb: a∾b}
+
+    F 1β€Ώ2β€Ώ3
+⟨ 1 3 ⟩
+
diff --git a/docs/help/nullcharacter.html b/docs/help/nullcharacter.html new file mode 100644 index 00000000..ffcc9f1b --- /dev/null +++ b/docs/help/nullcharacter.html @@ -0,0 +1,19 @@ + + + + BQN: Commercial At (`@`) + + +

Commercial At (@)

+

@: Null Character

+

Null character, codepoint 0 in ASCII. Has the status of any other character.

+

Can be added to any positive integer to get its character equivalent.

+↗️
    @+50
+'2'
+
+    @
+@
+
+    @+64
+'@'
+
diff --git a/docs/help/pi.html b/docs/help/pi.html new file mode 100644 index 00000000..f7db97a8 --- /dev/null +++ b/docs/help/pi.html @@ -0,0 +1,15 @@ + + + + BQN: Pi (`Ο€`) + + +

Pi (Ο€)

+

Ο€: Pi

+

Mathematical constant pi. Shares the same status as other numbers, can be negative (Β―Ο€).

+↗️
    Ο€
+3.141592653589793
+
+    Β―Ο€
+Β―3.141592653589793
+
diff --git a/docs/help/rightargument.html b/docs/help/rightargument.html new file mode 100644 index 00000000..70ded70a --- /dev/null +++ b/docs/help/rightargument.html @@ -0,0 +1,12 @@ + + + + BQN: Mathematical Double-struck X (`𝕩`) + + +

Mathematical Double-struck X (𝕩)

+

𝕩: Right Argument

+

A variable assigned to the right argument of a block. 𝕏 can be used to access the right argument as a function.

+↗️
    5 {𝕩} 1
+1
+
diff --git a/docs/help/separator.html b/docs/help/separator.html new file mode 100644 index 00000000..e719d8b4 --- /dev/null +++ b/docs/help/separator.html @@ -0,0 +1,21 @@ + + + + BQN: Diamond (`β‹„`) + + +

Diamond (β‹„)

+

β‹„: Separator

+

Separates statements in blocksβ‹„ programs and arrays.

+↗️
    a ← 3 β‹„ ⊒ b ← 2
+2
+
+    1 β‹„ 2 β‹„ 3
+3
+
+    ⟨1 β‹„ 2 β‹„ 3⟩
+⟨ 1 2 3 ⟩
+
+    {1 β‹„ 2 β‹„ 3}
+3
+
diff --git a/docs/help/separator1.html b/docs/help/separator1.html new file mode 100644 index 00000000..8461f453 --- /dev/null +++ b/docs/help/separator1.html @@ -0,0 +1,21 @@ + + + + BQN: Comma (`,`) + + +

Comma (,)

+

,: Separator

+

Separates statements in blocks, programs and arrays.

+↗️
    a ← 3 , ⊒ b ← 2
+2
+
+    1 , 2 , 3
+3
+
+    ⟨1, 2, 3⟩
+⟨ 1 2 3 ⟩
+
+    {1, 2, 3}
+3
+
diff --git a/docs/help/strand.html b/docs/help/strand.html new file mode 100644 index 00000000..56d407f1 --- /dev/null +++ b/docs/help/strand.html @@ -0,0 +1,16 @@ + + + + BQN: Undertie (`β€Ώ`) + + +

Undertie (β€Ώ)

+

β€Ώ: Strand

+

Create a list via strand notation.

+

Placing β€Ώ between valid BQN expressions will create a list out of the end results of those expressions.

+↗️
    1β€Ώ2β€Ώ3
+⟨ 1 2 3 ⟩
+
+    +β€Ώ-β€Ώ56
+⟨ + - 56 ⟩
+
diff --git a/docs/help/system.html b/docs/help/system.html new file mode 100644 index 00000000..ae887af1 --- /dev/null +++ b/docs/help/system.html @@ -0,0 +1,10 @@ + + + + BQN: Bullet (`β€’`) + + +

Bullet (β€’)

+

β€’: System

+

A prefix for system functions. β€’listSys gives a list of system values added in any BQN implementation.

+

β€’ is ignored when determining the role of the system value.

diff --git a/docs/repl.js b/docs/repl.js index cf7a9071..fc097829 100644 --- a/docs/repl.js +++ b/docs/repl.js @@ -129,7 +129,7 @@ let setPrefix = () => { let c = Array.from(d)[1]; let t = d.slice(1+c.length).replace(';','\n'); let k = revkeys[c]; if (k) t += '\n'+prefix+(k==='"'?'"':k); - x.hashelp = i < 64; + x.hashelp = i < 64; // comment out after patch for double struck x.title = primhelp[c] = t; }); } diff --git a/help/2-modifierrightoperand.md b/help/2-modifierrightoperand.md new file mode 100644 index 00000000..a85a552a --- /dev/null +++ b/help/2-modifierrightoperand.md @@ -0,0 +1,9 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/2-modifierrightoperand.html).* + +# Mathematical Double-struck G (`𝔾`) + +## `𝔾`: 2-Modifier Right operand + +A variable assigned to the right operand of a 2-modifier block. `π•˜` can be used to access the right operand as a value. + + 5 +{π•˜}3 1 \ No newline at end of file diff --git a/help/README.md b/help/README.md index 2d6d3cf1..d7c505d2 100644 --- a/help/README.md +++ b/help/README.md @@ -2,28 +2,44 @@ # REPL Help +Symbols are listed in alphabetical order of page name, ignoring syntactical roles. + | Symbol | Link | |--------|------| +| `𝔾` | [2-Modifier Right operand](2-modifierrightoperand.md) | | `\|` | [Absolute Value, Modulus](absolutevalue_modulus.md) | | `⟜` | [Bind, After, Dyadic After](after_bind.md) | -| `!` | [Assert, Dyad](assert_assertwithmessage.md) | +| `!` | [Assert, Assert With Message](assert_assertwithmessage.md) | | `∘` | [Atop, Dyadic Atop](atop.md) | | `⊸` | [Bind Left, Before, Dyadic Before](before_bind.md) | +| `{` | [Begin Block](beginblock.md) | +| `(` | [Begin Expression](beginexpression.md) | +| `⟨` | [Begin list](beginlist.md) | | `⎊` | [Catch](catch.md) | | `⌈` | [Ceiling, Maximum](ceiling_maximum.md) | | `˘` | [Cells](cells.md) | +| `←` | [Change](change.md) | | `β—Ά` | [Choose](choose.md) | | `⊐` | [Classify, Index Of](classify_indexof.md) | +| `#` | [Comment](comment.md) | | `+` | [Conjugate, Add](conjugate_add.md) | | `Λ™` | [Constant](constant.md) | +| `π•Š` | [Current Function](currentfunction.md) | +| `𝕣` | [Current Modifier](currentmodifier.md) | | `⍷` | [Deduplicate, Find](deduplicate_find.md) | +| `←` | [Define](define.md) | | `≑` | [Depth, Match](depth_match.md) | | `βš‡` | [Depth](depth.md) | | `β₯Š` | [Deshape, Reshape](deshape_reshape.md) | | `Β¨` | [Each](each.md) | | `<` | [Enclose, Lesser Than](enclose_lessthan.md) | +| `}` | [End Block](endblock.md) | +| `)` | [End Expression](endexpression.md) | +| `⟩` | [End list](endlist.md) | | `β‹ˆ` | [Enlist, Pair](enlist_pair.md) | | `⋆` | [Exponential, Power](exponential_power.md) | +| `⇐` | [Export Definition, Export names](export.md) | +| `.` | [Namespace Field](field.md) | | `⊏` | [First Cell, Select](firstcell_select.md) | | `βŠ‘` | [First, Pick](first_pick.md) | | `⌊` | [Floor, Minimum](floor_minimum.md) | @@ -35,16 +51,23 @@ | `⊣` | [Identity, Left](identity_left.md) | | `⊒` | [Identity, Right](identity_right.md) | | `/` | [Indices, Replicate](indices_replicate.md) | +| `∞` | [Infinity](infinity.md) | | `˝` | [Insert, Insert With initial](insert.md) | | `∾` | [Join, Join](join_jointo.md) | +| `𝕨` | [Left Argument](leftargument.md) | | `β‰ ` | [Length, Not Equal To](length_notequals.md) | | `≀` | [Lesser Than or Equal To](lessthanorequalto.md) | | `∊` | [Unique Mask, Member Of](markfirst_memberof.md) | | `>` | [Merge, Greater Than](merge_greaterthan.md) | +| `Β―` | [Minus](minus.md) | +| `𝔽` | [Modifier Left operand](modifierleftoperand.md) | | `-` | [Negate, Subtract](negate_subtract.md) | +| `Β·` | [Nothing](nothing.md) | | `Β¬` | [Logical Not, Span](not_span.md) | +| `@` | [Null Character](nullcharacter.md) | | `βŠ’` | [Occurrence Count, Progressive Index Of](occurrencecount_progressiveindexof.md) | | `β—‹` | [Atop, Over](over.md) | +| `Ο€` | [Pi](pi.md) | | `↑` | [Prefixes, Take](prefixes_take.md) | | `↕` | [Range, Windows](range_windows.md) | | `=` | [Rank, Equal To](rank_equals.md) | @@ -52,8 +75,11 @@ | `Γ·` | [Reciprocal, Divide](reciprocal_divide.md) | | `⍟` | [Repeat](repeat.md) | | `⌽` | [Reverse, Dyad](reverse_rotate.md) | +| `𝕩` | [Right Argument](rightargument.md) | | `` ` `` | [Scan, Scan With initial](scan.md) | | `˜` | [Self, Swap](self_swap.md) | +| `,` | [Separator](separator1.md) | +| `β‹„` | [Separator](separator.md) | | `β‰’` | [Shape, Not Match](shape_notmatch.md) | | `Β»` | [Shift After, Shift After](shiftafter.md) | | `Β«` | [Shift Before, Shift Before](shiftbefore.md) | @@ -62,7 +88,9 @@ | `∨` | [Sort Down, Logical Or](sortdown_or.md) | | `∧` | [Sort Up, Logical And](sortup_and.md) | | `√` | [Square root, Root](squareroot_root.md) | +| `β€Ώ` | [Strand](strand.md) | | `↓` | [Suffixes, Drop](suffixes_drop.md) | +| `β€’` | [System](system.md) | | `⌜` | [Each](table.md) | | `⍉` | [Transpose, Reorder Axes](transpose_reorderaxes.md) | | `⌾` | [Under](under.md) | diff --git a/help/assert_assertwithmessage.md b/help/assert_assertwithmessage.md index fc90b367..ad11a8d3 100644 --- a/help/assert_assertwithmessage.md +++ b/help/assert_assertwithmessage.md @@ -15,7 +15,7 @@ Throw an error if `𝕩` is not 1. -## `𝕨 ! 𝕩`: Dyad +## `𝕨 ! 𝕩`: Assert With Message Throw an error with message `𝕨` if `𝕩` is not 1. diff --git a/help/beginblock.md b/help/beginblock.md new file mode 100644 index 00000000..df6d58be --- /dev/null +++ b/help/beginblock.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/beginblock.html).* + +# Left Curly Bracket (`{`) + +## `{ ...`: Begin Block + +Starts a block, which can be one of: + +- Function +- 1-Modifier +- 2-Modifier +- Namespace +- Immediate Block + +Must end with a corresponding `}`. + + {𝕨 + 𝕩} # Function + + {𝕨‿𝔽‿𝕩} # 1-modifier + + {𝕨‿𝔽‿𝔾‿𝕩} # 2-modifier + + {a ⇐ 5} # Namespace + + {5+4+6} # Immediate block \ No newline at end of file diff --git a/help/beginexpression.md b/help/beginexpression.md new file mode 100644 index 00000000..8284e04f --- /dev/null +++ b/help/beginexpression.md @@ -0,0 +1,13 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/beginexpression.html).* + +# Left Parenthesis (`(`) + +## `( ...`: Begin Expression + +Starts an expression, and only one expression. Must end with a corresponding `)`. + +`(` gives higher precedence to the expression in it, and BQN will evaluate expressions in `()` first. + + 1 + 2 - 3 + + (1 + 2) - 3 \ No newline at end of file diff --git a/help/beginlist.md b/help/beginlist.md new file mode 100644 index 00000000..7f0a51c0 --- /dev/null +++ b/help/beginlist.md @@ -0,0 +1,16 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/beginlist.html).* + +# Mathematical Left Angle Bracket (`⟨`) + +## `⟨ ...`: Begin list + +Starts a list. Inner elements must be separated by `,` or `β‹„`. +Lists can be nested in other lists. + +Must end with a corresponding `⟩`. + + ⟨1, 2, 3⟩ + + ⟨+ β‹„ - β‹„ 56⟩ + + \ No newline at end of file diff --git a/help/change.md b/help/change.md new file mode 100644 index 00000000..d44d0a66 --- /dev/null +++ b/help/change.md @@ -0,0 +1,15 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/change.html).* + +# Leftwards Arrow With Hook (`←`) + +## `n ↩ v`: Change + +Changes the value of variable with name `n` to value `v`. + +Variable `n` must already exist. + + a ↩ 1 + + ⊒ b ← 3 + + ⊒ b ↩ "Be the change you wish to see in the world." \ No newline at end of file diff --git a/help/comment.md b/help/comment.md new file mode 100644 index 00000000..25943a31 --- /dev/null +++ b/help/comment.md @@ -0,0 +1,14 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/comment.html).* + +# Number Sign (`#`) + +## `#`: Comment + +Create a comment that extends till the end of a line. + +Anything written in comments is ignored. + + + 1 + 2 # + 3 + 4 + + "Hello world!" # this is ignored! \ No newline at end of file diff --git a/help/currentfunction.md b/help/currentfunction.md new file mode 100644 index 00000000..f2c5e16d --- /dev/null +++ b/help/currentfunction.md @@ -0,0 +1,14 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/currentfunction.html).* + +# Mathematical Double-struck S (`π•Š`) + +## `π•Š`: Current Function + +A variable assigned to the current function block. `𝕀` can be used to access the current function block as a value. + +`π•Š` can be used for recursion. + + F ← {π•Š 0: 1; 𝕩 Γ— π•Š 𝕩-1} # Factorial + F 5 + + {𝕀‿𝕀}4 \ No newline at end of file diff --git a/help/currentmodifier.md b/help/currentmodifier.md new file mode 100644 index 00000000..f76cc98a --- /dev/null +++ b/help/currentmodifier.md @@ -0,0 +1,10 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/currentmodifier.html).* + +# Mathematical Double-struck R (`𝕣`) + +## `𝕣`: Current Modifier + +A variable assigned to the current modifier block. Underscores must be added to the beginning and/or end (`_𝕣`, `_𝕣_`) to use the modifier with the correct role. + + + +{π•£βŠ£π•©} 4 \ No newline at end of file diff --git a/help/define.md b/help/define.md new file mode 100644 index 00000000..b36b5fc0 --- /dev/null +++ b/help/define.md @@ -0,0 +1,15 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/define.html).* + +# Leftwards Arrow (`←`) + +## `n ← v`: Define + +Defines a new variable with name `n` and value `v`. + +Variable `n` must not already exist. + + ⊒ a ← 1 + + ⊒ b ← 3β€Ώ3 β₯Š 5 + + C ← ↑ \ No newline at end of file diff --git a/help/endblock.md b/help/endblock.md new file mode 100644 index 00000000..a10aa907 --- /dev/null +++ b/help/endblock.md @@ -0,0 +1,17 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/endblock.html).* + +# Right Curly Bracket (`}`) + +## `... }`: End Block + +Starts a block, which starts with `}`. See [Begin Block](beginblock.md) for more details. + + {𝕨 + 𝕩} # Function + + {𝕨‿𝔽‿𝕩} # 1-modifier + + {𝕨‿𝔽‿𝔾‿𝕩} # 2-modifier + + {a ⇐ 5} # Namespace + + {5+4+6} # Immediate block \ No newline at end of file diff --git a/help/endexpression.md b/help/endexpression.md new file mode 100644 index 00000000..d65f6520 --- /dev/null +++ b/help/endexpression.md @@ -0,0 +1,12 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/endexpression.html).* + +# Right Parenthesis (`)`) + +## `... )`: End Expression + +The closing symbol for `(`. See [Begin Expression](beginexpression.md) for more details. + + + 1 + 2 - 3 + + (1 + 2) - 3 \ No newline at end of file diff --git a/help/endlist.md b/help/endlist.md new file mode 100644 index 00000000..9d698dcc --- /dev/null +++ b/help/endlist.md @@ -0,0 +1,14 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/endlist.html).* + +# Mathematical Right Angle Bracket (`⟩`) + +## `... ⟩`: End list + +Ends a list started by a `⟨`. See [Begin List](beginlist.md) for more details. + + + ⟨1, 2, 3⟩ + + ⟨+ β‹„ - β‹„ 56⟩ + + \ No newline at end of file diff --git a/help/export.md b/help/export.md new file mode 100644 index 00000000..39821667 --- /dev/null +++ b/help/export.md @@ -0,0 +1,19 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/export.html).* + +# Leftward Double Arrow (`⇐`) + +## `n ⇐ v`: Export Definition + +Define a variable with name `n` and export it from the current namespace or program's scope. + + ns ← { exported ⇐ 5, unexported ← 0} + ns.exported + ns.unexported + +## `𝕨 ⇐`: Export names + +Export the names given in `𝕩` from the current namespace or program's scope. Names must be defined. + + ns1 ← { ⟨alsoexportedβŸ©β‡, exported ⇐ 5, alsoexported ← 0} + ns1.exported + ns1.alsoexported \ No newline at end of file diff --git a/help/field.md b/help/field.md new file mode 100644 index 00000000..c866e0a8 --- /dev/null +++ b/help/field.md @@ -0,0 +1,11 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/field.html).* + +# Full Stop (`.`) + +## `ns . name`: Namespace Field + +Access a field with name `name` in namespace `ns`. Field must have been exported with `⇐`. + + {a⇐1} . a + + {F⇐-}.F 5 \ No newline at end of file diff --git a/help/genhelp.bqn b/help/genhelp.bqn index cf50c939..b4a5b8c9 100755 --- a/help/genhelp.bqn +++ b/help/genhelp.bqn @@ -5,15 +5,17 @@ thing ← { names ← (⊣∾", "∾⊒)Β΄{(¬·∧`' '⊸=)⊸/⌾⌽(2+βŠ‘/':'=𝕩)↓𝕩}Β¨("## "≑3βŠΈβ†‘)¨⊸/data tβ€Ώd ← ∾/Β¨(⊏data)=Β¨"()" sym ← "`"∾˜"`"∾{'`':"` ` `"; '|':"\"βˆΎπ•© ; 𝕩}Β―3βŠ‘2βŠ‘data - β€’Show "| " ∾ sym ∾ " | [" ∾ names ∾ "]("∾((t+1)↓dβ†‘βŠ‘data)∾ ") |" -}Β¨β€’args + β€’Show "| " ∾ sym ∾ " | [" ∾ names ∾ "]("βˆΎπ•©βˆΎ ") |" +}Β¨β€’args(¬∘∊/⊣)⟨"README.md"⟩ head ← ⟨ "*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/index.html).*" ⟨⟩ "# REPL Help" ⟨⟩ +"Symbols are listed in alphabetical order of page name, ignoring syntactical roles." +⟨⟩ "| Symbol | Link |" "|--------|------|" ⟩ -"index.md.tmp" β€’FLines head ∾ thing #rename once you have a proper file. \ No newline at end of file +"README.md" β€’FLines head ∾ thing #rename once you have a proper file. \ No newline at end of file diff --git a/help/infinity.md b/help/infinity.md new file mode 100644 index 00000000..5ea6cb3f --- /dev/null +++ b/help/infinity.md @@ -0,0 +1,14 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/infinity.html).* + +# Infinity (`∞`) + +## `∞`: Infinity + +Mathematical constant Infinity. Shares the same status as other numbers, can be negative (`¯∞`). + + + ∞ + + ¯∞ + + 1+∞ \ No newline at end of file diff --git a/help/leftargument.md b/help/leftargument.md new file mode 100644 index 00000000..3b179335 --- /dev/null +++ b/help/leftargument.md @@ -0,0 +1,9 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/leftargument.html).* + +# Mathematical Double-struck W (`𝕨`) + +## `𝕨`: Left Argument + +A variable assigned to the left argument of a block. `π•Ž` can be used to access the left argument as a function. + + 5 {𝕨} 1 \ No newline at end of file diff --git a/help/minus.md b/help/minus.md new file mode 100644 index 00000000..2d85e1e7 --- /dev/null +++ b/help/minus.md @@ -0,0 +1,14 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/minus.html).* + +# Macron (`Β―`) + +## `Β―`: Minus + +Prefix before numbers to indicate that they are negative. + +Note that this is not the same as `-`, since it is part of the number, rather than a primitive that negates its value. + + + -1β€Ώ2β€Ώ3 + + Β―1β€Ώ2β€Ώ3 \ No newline at end of file diff --git a/help/modifierleftoperand.md b/help/modifierleftoperand.md new file mode 100644 index 00000000..2f23d37f --- /dev/null +++ b/help/modifierleftoperand.md @@ -0,0 +1,9 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/modifierleftoperand.html).* + +# Mathematical Double-struck F (`𝔽`) + +## `𝔽`: Modifier Left operand + +A variable assigned to the left operand of a modifier block. `𝕗` can be used to access the left operand as a value. + + 5 +{π•—βŠ£π•¨} 1 \ No newline at end of file diff --git a/help/nothing.md b/help/nothing.md new file mode 100644 index 00000000..b5ef7fe3 --- /dev/null +++ b/help/nothing.md @@ -0,0 +1,23 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/nothing.html).* + +# Middle Dot (`Β·`) + +## `Β·`: Nothing + +### In Trains + +Nothing can serve as a left argument in a train to string together multiple monadic functions. + + (-+-) 5 + + (-Β·+-) 5 + +### In Block Headers + +For Block header pattern matching syntax, Nothing can be used to indicate an unused value. + + F ← {π•Š aβ€ΏΒ·β€Ώb: a∾b} + + F 1β€Ώ2β€Ώ3 + + \ No newline at end of file diff --git a/help/nullcharacter.md b/help/nullcharacter.md new file mode 100644 index 00000000..b13eb3f0 --- /dev/null +++ b/help/nullcharacter.md @@ -0,0 +1,16 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/nullcharacter.html).* + +# Commercial At (`@`) + +## `@`: Null Character + +Null character, codepoint 0 in ASCII. Has the status of any other character. + +Can be added to any positive integer to get its character equivalent. + + + @+50 + + @ + + @+64 \ No newline at end of file diff --git a/help/pi.md b/help/pi.md new file mode 100644 index 00000000..0787e7ee --- /dev/null +++ b/help/pi.md @@ -0,0 +1,12 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/pi.html).* + +# Pi (`Ο€`) + +## `Ο€`: Pi + +Mathematical constant pi. Shares the same status as other numbers, can be negative (`Β―Ο€`). + + + Ο€ + + Β―Ο€ \ No newline at end of file diff --git a/help/rightargument.md b/help/rightargument.md new file mode 100644 index 00000000..69ec6394 --- /dev/null +++ b/help/rightargument.md @@ -0,0 +1,9 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/rightargument.html).* + +# Mathematical Double-struck X (`𝕩`) + +## `𝕩`: Right Argument + +A variable assigned to the right argument of a block. `𝕏` can be used to access the right argument as a function. + + 5 {𝕩} 1 \ No newline at end of file diff --git a/help/separator.md b/help/separator.md new file mode 100644 index 00000000..9c02aa59 --- /dev/null +++ b/help/separator.md @@ -0,0 +1,15 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/separator.html).* + +# Diamond (`β‹„`) + +## `β‹„`: Separator + +Separates statements in blocksβ‹„ programs and arrays. + + a ← 3 β‹„ ⊒ b ← 2 + + 1 β‹„ 2 β‹„ 3 + + ⟨1 β‹„ 2 β‹„ 3⟩ + + {1 β‹„ 2 β‹„ 3} \ No newline at end of file diff --git a/help/separator1.md b/help/separator1.md new file mode 100644 index 00000000..90296f2f --- /dev/null +++ b/help/separator1.md @@ -0,0 +1,15 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/separator1.html).* + +# Comma (`,`) + +## `,`: Separator + +Separates statements in blocks, programs and arrays. + + a ← 3 , ⊒ b ← 2 + + 1 , 2 , 3 + + ⟨1, 2, 3⟩ + + {1, 2, 3} \ No newline at end of file diff --git a/help/strand.md b/help/strand.md new file mode 100644 index 00000000..9866f79b --- /dev/null +++ b/help/strand.md @@ -0,0 +1,16 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/strand.html).* + +# Undertie (`β€Ώ`) + +## `β€Ώ`: Strand + +Create a list via [strand notation](../doc/arrayrepr.md#strands). + +Placing `β€Ώ` between valid BQN expressions will create a list out of the end results of those expressions. + + + 1β€Ώ2β€Ώ3 + + +β€Ώ-β€Ώ56 + + \ No newline at end of file diff --git a/help/system.md b/help/system.md new file mode 100644 index 00000000..79b1d745 --- /dev/null +++ b/help/system.md @@ -0,0 +1,9 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/system.html).* + +# Bullet (`β€’`) + +## `β€’`: System + +A prefix for system functions. `β€’listSys` gives a list of system values added in any BQN implementation. + +`β€’` is ignored when determining the role of the system value. -- cgit v1.2.3
𝔾2-Modifier Right operand
| Absolute Value, Modulus
!Assert, DyadAssert, Assert With Message
∘Bind Left, Before, Dyadic Before
{Begin Block
(Begin Expression
⟨Begin list
⎊ Catch
Cells
←Change
β—Ά Choose
Classify, Index Of
#Comment
+ Conjugate, Add
Constant
π•ŠCurrent Function
𝕣Current Modifier
⍷ Deduplicate, Find
←Define
≑ Depth, Match
Enclose, Lesser Than
}End Block
)End Expression
⟩End list
β‹ˆ Enlist, Pair
Exponential, Power
⇐Export Definition, Export names
.Namespace Field
⊏ First Cell, Select
Indices, Replicate
∞Infinity
˝ Insert, Insert With initial
Join, Join
𝕨Left Argument
β‰  Length, Not Equal To
Merge, Greater Than
Β―Minus
𝔽Modifier Left operand
- Negate, Subtract
Β·Nothing
Β¬ Logical Not, Span
@Null Character
βŠ’ Occurrence Count, Progressive Index Of
Atop, Over
Ο€Pi
↑ Prefixes, Take
Reverse, Dyad
𝕩Right Argument
` Scan, Scan With initial
Self, Swap
,Separator
β‹„Separator
β‰’ Shape, Not Match
Square root, Root
β€ΏStrand
↓ Suffixes, Drop
β€’System
⌜ Each