From 8ce5cd048f0d0c1ea2ad688aab1d59c85101fc6c Mon Sep 17 00:00:00 2001 From: James Clark Date: Fri, 27 Mar 2020 16:26:21 +0700 Subject: [PATCH] Move error type into behavioral category Part of #463. --- lang/spec.html | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/lang/spec.html b/lang/spec.html index a74ba70e..9562da04 100644 --- a/lang/spec.html +++ b/lang/spec.html @@ -505,7 +505,7 @@

Type descriptors

text items - basic, structured + basic, structured array an ordered list of values, optionally with a specific length, where a single type is specified for all members of the list @@ -530,12 +530,12 @@

Type descriptors

a two-dimensional collection of immutable values + basic, behavioral error an indication that there has been an error, with a string identifying the reason for the error, and a mapping giving additional details about the error - basic, behavioral function a function with 0 or more specified parameter types and a single return type @@ -1128,9 +1128,7 @@
XML namespaces

Structured values

-There are four basic types of structured value. First, there are two container -basic types: list and mapping. Second, there are the table and error basic -types, which are each special in different ways. +There are three basic types of structured value: list, mapping and table.

A structured value is either mutable or immutable; whether it is mutable or @@ -1177,7 +1175,6 @@

Structured values

list-type-descriptor | mapping-type-descriptor | table-type-descriptor - | error-type-descriptor

The following table summarizes the type descriptors for structured types. @@ -1547,6 +1544,22 @@

[Preview] Tables

+ +
+

Behavioral values

+ +
behavioral-type-descriptor :=
+   error-type-descriptor
+   | function-type-descriptor
+   | object-type-descriptor
+   | future-type-descriptor
+   | service-type-descriptor
+   | typedesc-type-descriptor
+   | handle-type-descriptor
+   | stream-type-descriptor
+
+

Error

@@ -1559,10 +1572,9 @@

Error

inferred-error-type-param := *

-An error value belongs to the error basic type, which is a basic type which is -distinct from other structured types and is used only for representing errors. -The error type is inherently immutable. An error value contains the following -information: +An error value belongs to the error basic type, which is used only for +representing errors. The error type is inherently immutable. An error value +contains the following information:

  • a reason, which is a string identifier for the category of error
  • @@ -1617,21 +1629,6 @@

    Error

    Error is the only structured basic type that is not iterable.

-
-
-

Behavioral values

- -
behavioral-type-descriptor :=
-   function-type-descriptor
-   | object-type-descriptor
-   | future-type-descriptor
-   | service-type-descriptor
-   | typedesc-type-descriptor
-   | handle-type-descriptor
-   | stream-type-descriptor
-
-

Functions