aboutsummaryrefslogtreecommitdiff
path: root/doc/namespace.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2023-01-26 20:15:30 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2023-01-26 20:15:30 -0500
commitd4e2b6542548cd2b60815185aaf021d44dca1ff7 (patch)
tree554ae534cd13af7762d889bb41dc40446b8d0c0f /doc/namespace.md
parentfe5ed9ad1a2c3cb2b02c4d36077f6acbddc5a11b (diff)
More explicit documentation about roles in a few places
Diffstat (limited to 'doc/namespace.md')
-rw-r--r--doc/namespace.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/namespace.md b/doc/namespace.md
index 896b2ffb..d7fc4562 100644
--- a/doc/namespace.md
+++ b/doc/namespace.md
@@ -46,7 +46,7 @@ There are also two ways to get values out of a namespace, such as `example` defi
{n⇐7}.n
-The part on the left can be anything with a subject role, although it will often need to be parenthesized because `.` has higher precedence than any operator. This allows it to be chained like `a.b.c` if a namespace has a value that is also a namespace (and so on).
+The part on the left can be anything with a subject [role](expression.md#syntactic-role), although it will often need to be parenthesized because `.` has higher precedence than any operator. So it can be chained like `a.b.c` if a field has a value that is also a namespace (and so on). The overall role is determined by the last name: for example `•math.Sin` has a function role.
Second, a namespace might be used in a [destructuring](expression.md#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 `b2⇐b`. 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 variable names defined can't be—and all the names can be spelled with any role (the role is ignored).