From 15679e479511b0fa6eed8909a4cd5bc5e039b41d Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 15 Aug 2021 16:28:55 -0400 Subject: Clarify that the main name in a header is only internal --- docs/doc/block.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs/doc') diff --git a/docs/doc/block.html b/docs/doc/block.html index a3fa4397..fa5174c4 100644 --- a/docs/doc/block.html +++ b/docs/doc/block.html @@ -135,8 +135,13 @@

Because 𝕣 only ever refers to a 1-modifier or 2-modifer, it can never make sense to refer to it as a function, and the uppercase letter is not recognized by BQN. In order to allow 𝕣 to be spelled as a 1-modifier _𝕣 or 2-modifier _𝕣_, it is treated as an ordinary identifier character, so it must be separated from letters or numbers by spaces.

Block headers

-

As a program becomes larger, it often becomes necessary to name inputs to blocks rather than just using special names. It can also become difficult to identify what kind of block is being defined, as it requires scanning through the block for special names. A block header, which is separated from the body of a block by a colon :, specifies the kind of block and can declare names for the block and its inputs. Its syntax mirrors an application of the block. As suggested by the positioning, the names given in a header apply only inside the block.

-
# A dyadic function called Func
+

As a program becomes larger, it often becomes necessary to name inputs to blocks rather than just using special names. It can also become difficult to identify what kind of block is being defined, as it requires scanning through the block for special names. A block header, which is separated from the body of a block by a colon :, specifies the kind of block and can declare names for the block and its inputs.

+
Fact  { F n:
+  n × (0<)1F n-1
+}
+
+

Its syntax mirrors an application of the block. As suggested by the positioning, the names given in a header apply only inside the block: for example F above is only defined inside the {} braces while Fact could be used either outside or inside. Some other possibilites are given below.

+
# A dyadic function that refers to itself as Func
 { l Func r:
   
 
@@ -152,7 +157,7 @@
 { F _op_ val:
   
 
-

In all cases special names are defined just as with a headerless function. In this respect the effect of the header is the same as a series of assignments at the beginning of a function, such as the following translation of the second header above:

+

In all cases special names still work just like in a headerless function. In this respect the effect of the header is the same as a series of assignments at the beginning of a function, such as the following translation of the second header above:

{ # Fn _apply ⟨a,b⟩:
   Fn  𝔽
   _apply  _𝕣
-- 
cgit v1.2.3