From 1a5fa6f8c9474e06ff7938c37f77450bf4528d5a Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 10 Mar 2023 20:07:42 -0500 Subject: =?UTF-8?q?=E2=80=A2ns=20specification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/spec/system.html | 29 +++++++++++++++++++++++++++++ spec/system.md | 13 +++++++++++++ 2 files changed, 42 insertions(+) diff --git a/docs/spec/system.html b/docs/spec/system.html index 20cb39e9..3e126a34 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -41,6 +41,10 @@ •Type, •Glyph, •Source, •Decompose +Namespaces +•ns + + Time •UnixTime, •Delay, •_timed, … @@ -569,6 +573,31 @@ +

Namespaces

+

The system namespace •ns contains functionality for working with namespaces.

+ + + + + + + + + + + + + + + + + + + + + +
NameSummary
KeysList of normalized field names in 𝕩
Has1 if 𝕨 contains a field named 𝕩 and 0 otherwise
GetCurrent value in 𝕨 of the field named 𝕩
+

Keys returns field names as strings, normalized in the sense that all underscores are removed and alphabetic characters are converted to lowercase. The order of the names is unspecified. Has and Get accept names with any spelling. Get causes an error if 𝕩 isn't the name of a field of 𝕨, while Has causes an error only if it isn't a string, returning 0 for any string that isn't a valid name.

Time

diff --git a/spec/system.md b/spec/system.md index fe216f2e..5412f090 100644 --- a/spec/system.md +++ b/spec/system.md @@ -16,6 +16,7 @@ All system values described in the BQN specification are optional: an implementa | [Input and output](#input-and-output) ([terminal](#terminal-io)) | `•Out`, `•Show`, `•Repr`, `•Fmt`, …, `•term` | [Interface](#interface) ([FFI](#foreign-function-interface)) | `•SH`, `•FFI` | [Operation properties](#operation-properties) | `•Type`, `•Glyph`, `•Source`, `•Decompose` +| [Namespaces](#namespaces) | `•ns` | [Time](#time) | `•UnixTime`, `•Delay`, `•_timed`, … | [Math](#math) | `•math` | [Random generation](#random-generation) | `•rand`, `•MakeRand` @@ -268,6 +269,18 @@ Each function in this section is monadic. | 1-mod | 4 | `𝕗,𝕣` | 2-mod | 5 | `𝕗,𝕣,𝕘` +## Namespaces + +The system namespace `•ns` contains functionality for working with namespaces. + +| Name | Summary +|--------|------------------------------- +| `Keys` | List of normalized field names in `𝕩` +| `Has` | `1` if `𝕨` contains a field named `𝕩` and `0` otherwise +| `Get` | Current value in `𝕨` of the field named `𝕩` + +`Keys` returns field names as strings, normalized in the sense that all underscores are removed and alphabetic characters are converted to lowercase. The order of the names is unspecified. `Has` and `Get` accept names with any spelling. `Get` causes an error if `𝕩` isn't the name of a field of `𝕨`, while `Has` causes an error only if it isn't a string, returning `0` for any string that isn't a valid name. + ## Time | Name | Summary -- cgit v1.2.3