From f31934418dadd7fd7e5ea31634a40d3e9e4edfdc Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 21 Jan 2021 20:41:53 -0500 Subject: Fill for a string literal is a character --- docs/spec/inferred.html | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/spec') diff --git a/docs/spec/inferred.html b/docs/spec/inferred.html index 34d4725d..251c35c4 100644 --- a/docs/spec/inferred.html +++ b/docs/spec/inferred.html @@ -71,6 +71,7 @@

Fill elements

Any BQN array can have a fill element, which is a sort of "default" value for the array. The reference implementations use Fill to access this element, and it is used primarily for Take (), First (), and Nudge («, »). One way to extract the fill element of an array a in BQN is 0a.

A fill element can be either 0, ' ', or an array of valid fill elements. If the fill element is an array, then it may also have a fill element (since it is an ordinary BQN array). The fill element is meant to describe the shared structure of the elements of an array: for example, the fill element of an array of numbers should be 0, while the fill element for an array of variable-length lists should probably be ⟨⟩. However, the fill element, unlike other inferred properties, does not satisfy any particular constraints that relate it to its array.

+

In addition to the requirements below, the fill element for the value of a string literal is ' '.

Required functions

Combinators ⊣⊢!˙˜´˝∘○⊸⟜⊘◶⍟ do not affect fill element computation: if the combinator calls a function that computes a fill element, then that fill element must be retained if the result is passed to other functions or returned. constructs arrays if its right operand is or contains arrays, and the fill elements of these arrays are not specified; converting 𝕩 to a fill element is a reasonable choice in some cases but not others.

Arithmetic primitives—all valences of +-×÷⋆√⌊⌈|¬∧∨ and dyadic <>≠=≤≥—obtain their fill elements by applying to the fill elements of the arguments. If this is an error, there is no fill element; otherwise, the fill element is the result, with all numbers in it changed to 0 and all characters changed to ' '.

-- cgit v1.2.3