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/quick.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/doc/quick.html') diff --git a/docs/doc/quick.html b/docs/doc/quick.html index 5b7061a9..64eefcd7 100644 --- a/docs/doc/quick.html +++ b/docs/doc/quick.html @@ -242,7 +242,7 @@

Going left to right, GVโ€ฟGS indicates destructuring assignment, which will expect a list of two values on the right and take it apart to assign the two names. The right hand side is the function {๐•ยจ}ยจ applied to a list.

{๐•ยจ} is a block function, like Split but a lot shorter. It uses the uppercase ๐• instead of ๐•ฉ, so that it treats ๐•ฉ as a function (it doesn't require it to be a function, though: see mixing roles). It adds an Each ยจ onto its argument. This is used to convert the two functions in the list from functions that work on a namespaces to functions that work on a list of them.

The list is split across two lines, using newline as a separator instead of , or โ‹„. Its second function {๐•ฉ.spl} is simpler: it takes a namespace ๐•ฉ and gets the field named spl.

-

The first function is more complicated, because the argument namespace might or might not have an str field. The list-like notation โŸจsโ‡strโŸฉ is another example of destructuring assignment, but this time it destructures a namespace, using an alias to give it a short name. This header leaves off the function name ๐•Š, using a special rule for one-argument functions. Arguments in headers are very similar to assignment targets, but if the destructuring doesn't match it tries the next body (if there is one) instead of giving an error. So if the argument is a namespace with an str field then {โŸจsโ‡strโŸฉ:s;""} returns that field's value, and otherwise it returns "".

+

The first function is more complicated, because the argument namespace might or might not have an str field. The list-like notation โŸจsโ‡strโŸฉ is another example of destructuring assignment, but this time it destructures a namespace, using an alias to give it a short name. This header leaves off the function name ๐•Š, using a special rule for one-argument functions. Arguments in headers are very similar to assignment targets, but if the destructuring doesn't match it tries the next body (if there is one) instead of giving an error. So if the argument is a namespace with an str field then {โŸจsโ‡strโŸฉ:s;""} returns that field's value, and otherwise it returns "".

Assembly

Now that Split has defined Proc, GV (get value), and GS (get split), it's ready to do its work.

r โ† Proc{ยป๐”ฝยจโŠข} ๐•ฉ
-- 
cgit v1.2.3