From 6267150a30c482dd5539689a4afc508f7855ef24 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 22 Dec 2020 21:49:26 -0500 Subject: Spec commentary sections on combinators and array properties --- docs/spec/primitive.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs/spec/primitive.html') diff --git a/docs/spec/primitive.html b/docs/spec/primitive.html index 53a74f25..e62158f2 100644 --- a/docs/spec/primitive.html +++ b/docs/spec/primitive.html @@ -68,3 +68,28 @@ +

Commentary on other primitives

+

As noted above, see reference.bqn for the authoritative definitions. Commentary here gives an overall description and highlights implementation subtleties and edge cases.

+

Combinators

+

There's little to say about BQN's true combinators, since each is simply a pattern of function application. All primitive combinators use their operands as functions, and thus treat a data operand as a constant function.

+ +

The somewhat complicated definition of Valences could be replaced with {𝔽𝕩;𝕨𝔾𝕩} using headers. However, reference.bqn uses a simple subset of BQN's syntax that doesn't include headers. Instead, the definition relies on the fact that 𝕨 works like · if no left argument is given: (1˙𝕨)-0 is 1-0 or 1 if 𝕨 is present and (1˙·)-0 otherwise: this reduces to ·-0 or 0.

+

Array properties

+

The reference implementations extend Shape () to atoms as well as arrays, in addition to implementing other properties. In all cases, an atom behaves as if it has shape ⟨⟩. The functions in this section never cause an error.

+ -- cgit v1.2.3