From 95cc441b4aefd08d562cf0ee1110db25ba7afdb0 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 12 Sep 2021 20:15:58 -0400 Subject: Allow system values to create new BQN types even in a non-extended implementation --- spec/README.md | 2 +- spec/types.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/README.md b/spec/README.md index 5d71ec9b..554deca0 100644 --- a/spec/README.md +++ b/spec/README.md @@ -25,4 +25,4 @@ In several cases, an implementation can choose between more than one possible be - If the specification does not identify the fill element for an array, then any or no fill can be deterministically chosen. - If an expression in a program cannot be evaluated without error (that is, there is no context that would cause the program, or a caller with access to its result, to evaluate the expression but not eventually fail with an error), then the implementation may reject this program, giving an error before evaluating any code and regardless of context—in this case, it must not accept the program in any context. This "compiler clause" modifies the behavior described above. - The way the program's output (either a result or an error) is displayed to the user is not specified. -- Any system values can be implemented, and they may act in an arbitrary way including modifying the behavior of the rest of the program. If system values with names given in this specification are implemented, however, then they must conform with the specified behavior. +- Any system values can be implemented, and they may act in an arbitrary way including modifying the behavior of the rest of the program. System values can create values with types not included in the specification, whose behavior is left up to the implementation. If system values with names given in this specification are implemented, however, then they must conform with the specified behavior. diff --git a/spec/types.md b/spec/types.md index 4549fd04..dc596563 100644 --- a/spec/types.md +++ b/spec/types.md @@ -11,7 +11,9 @@ BQN programs manipulate data of seven types: - 2-Modifier - Namespace -Of these, the first three are considered *data types* and the next three *operation types*. We first describe the operation types and the namespace; the remainder of this page will be dedicated to the data types. A member of any operation type accepts some number of *inputs* and either returns a *result* or causes an error; inputs and the result are values of any type. When a function is given inputs (*called*), it may produce side effects before returning, such as manipulating variables and calling other functions within its scope, or performing I/O. +Beyond these, an implementation may define [system values](system.md) that create values of other types. The behavior of such values is not specified and is left up to the implementation. + +Of the types specified, the first three are considered *data types* and the next three *operation types*. We first describe the operation types and the namespace; the remainder of this page will be dedicated to the data types. A member of any operation type accepts some number of *inputs* and either returns a *result* or causes an error; inputs and the result are values of any type. When a function is given inputs (*called*), it may produce side effects before returning, such as manipulating variables and calling other functions within its scope, or performing I/O. - A *function* takes one (monadic call) or two (dyadic call) *arguments*. - A *1-modifier* takes one *operand*. - A *2-modifier* takes two *operands*. -- cgit v1.2.3