From fa1617d0e9020f67abb1ce5ae84293b70c1adec3 Mon Sep 17 00:00:00 2001 From: James Clark Date: Fri, 12 Aug 2022 08:51:41 +0700 Subject: [PATCH] Clarify error-handling within a query-expr Fixes #871 --- lang/spec.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lang/spec.html b/lang/spec.html index d16f8a57..4762d2ad 100644 --- a/lang/spec.html +++ b/lang/spec.html @@ -6622,11 +6622,19 @@

Query expression

clause. The input to the first clause is a single empty frame.

-The execution of a clause may complete early with an error value, in which case -this error value is the result of the query, except when constructing a stream. -Otherwise, the result of evaluating a query expression is a single value, which -is constructed from the sequence of values emitted by the last clause. The -result must be one of the following basic types: +When a from or join clause is executed, it makes calls +to the next method of an Iterator object. If any of these calls +return an error value e, then we say that the clause completes +early with error value e. +

+

+A query-expr that does not construct a stream is evaluated as described in this +paragraph. If a clause completes early with error value e, then the +result of evaluating the query-expr is e. The normal rules apply if +the execution of any clause results in the evaluation of an expression +completing abruptly. Otherwise, the result of evaluating a query expression is a +single value, which is constructed from the sequence of values emitted by the +last clause. The result must be one of the following basic types: