From 9c2599cb11346602f84d32a2e327580547f19fa1 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 30 Jan 2022 18:02:45 -0500 Subject: Document destructuring assignment --- docs/doc/namespace.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/doc/namespace.html') diff --git a/docs/doc/namespace.html b/docs/doc/namespace.html index a0c06d75..ece4d6b6 100644 --- a/docs/doc/namespace.html +++ b/docs/doc/namespace.html @@ -32,10 +32,10 @@ }

Imports

-

There are also two ways to get values out of a namespace, such as example defined above. First, it might be used in a destructuring assignment like the one below. This assignment's target looks like a list, where each entry specifies one of the names exported by the block and what it should be assigned to. The element can be either a single name, like b, which gives both, or an aliasing expression like b2b. In this case, the value b from the namespace is used, but it's given the name b2 instead of b. Imported names can be repeated—but the variables defined can't—and all the names can be spelled with any role (the role is ignored).

+

There are also two ways to get values out of a namespace, such as example defined above. First, it might be used in a destructuring assignment like the one below. This assignment's target looks like a list, where each entry specifies one of the names exported by the block and what it should be assigned to. The element can be either a single name, like b, which gives both, or an aliasing expression like b2b. In this case, the value b from the namespace is used, but it's given the name b2 instead of b. Imported names can be repeated—but the variables defined can't—and all the names can be spelled with any role (the role is ignored).

aliasa, b, c0c1c, b2b  example
 
-

If aliasing with is never used, the names can be given as a strand with .

+

If aliasing with is never used (or each use is parenthesized), the names can be given as a strand with .

ca  example
 

The arrows used for importing don't indicate that the surrounding block is a namespace or export variables. However, a single statement can both import and export, if it's a destructuring assignment and the main assignment arrow is .

-- cgit v1.2.3