From e7f09d54e76d61709763dcaf1b3081812d88fe46 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 18 Nov 2022 22:10:59 -0500 Subject: Move introduction of the optional-function rule to main header section, not multiple bodies --- docs/doc/block.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/doc/block.html') diff --git a/docs/doc/block.html b/docs/doc/block.html index cfffe895..115f47ec 100644 --- a/docs/doc/block.html +++ b/docs/doc/block.html @@ -184,6 +184,7 @@

Special names in headers

Any element of a function or modifier header can be left nameless by using the corresponding special name in that position, instead of an identifier. For example, the header 𝕨 𝔽_𝕣_𝔾 𝕩: incorporates as much vagueness as possible. It indicates a deferred 2-modifier, but provides no other information.

The name 𝕨 in this context can refer to either a left argument or no left argument, allowing a header with arguments to be used even for an ambiguous function. Recall that 𝕨 is the only token other than Β· that can have no value. If an identifier or list is given as the left argument, then the function must be called with a left argument.

+

If a header consists of π•Š with one argument, like π•Š aβ€Ώb: or π•Šπ•©:, the π•Š can be left off. See case headers below for examples. The exception is if the argument is a plain name, as in π•Š arg:, because the header arg: is a label for an immediate block as described in the next section.

Short headers

A header can also be a plain name with no inputs, called a label. A label specifies the type of the block and gives an internal name that can be used to refer to it, but doesn't specify the inputs.

{ b:   # Block
@@ -223,7 +224,7 @@
 Error: No header matched arguments
 

Case headers

-

A special rule allows for convenient case-matching syntax for one-argument functions. In any function header with one argument, the function name can be omitted as long as the argument is not a plain identifierβ€”it must be 𝕩 or a compound value like a list to distinguish it from an immediate block label.

+

The optional π•Š rule makes for convenient case-matching syntax in one-argument functions.

↗️
    Test ← {
       "abc": "string" ;
       ⟨2,b⟩: βŒ½π•©       ;
-- 
cgit v1.2.3