From 78e5d53c981691b2022bbb657cba3da0747444c5 Mon Sep 17 00:00:00 2001 From: Michael Kay Date: Mon, 15 Apr 2024 18:22:29 +0100 Subject: [PATCH] Correction to definition of focus functions --- specifications/xquery-40/src/expressions.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/specifications/xquery-40/src/expressions.xml b/specifications/xquery-40/src/expressions.xml index 5578e2cee..f660eae5d 100644 --- a/specifications/xquery-40/src/expressions.xml +++ b/specifications/xquery-40/src/expressions.xml @@ -9902,12 +9902,13 @@ return $incrementors[2](4)]]> and . For example, $s => tokenize() =!> fn { `"{.}"` }() first tokenizes the string $s, then wraps each token in double quotation marks.

-

The expression function { EXPR } (or fn { EXPR }) is a syntactic shorthand for the expression - function($Z as item()*) as item()* { $Z ! (EXPR) }, where $Z is a variable name that is - otherwise unused. Note that the function body (EXPR) is evaluated with a : - the context position and context size will always be 1 (one).

- 2023-09-14TODO: The above no longer works. We don't currently have any construct (other than this one) that sets - the context value to something other than a singleton. +

The result of calling the function { EXPR } (or fn { EXPR }), with + a single argument whose value is $Z arguments, is obtained by evaluating EXPR + with a dynamic context in which the context value is $Z, the context position is 1 (one), + and the context size is 1 (one).

+ +

For example, the expression every(1 to 10, fn{. gt 0}) returns true.

+