W3C home > Mailing lists > Public > public-qt-comments@w3.org > October 2002

focus over function calls

From: Per Bothner <per@bothner.com>
Date: Fri, 18 Oct 2002 15:31:37 -0400 (EDT)
Message-ID: <3DB06177.7040606@bothner.com>
To: public-qt-comments@w3.org




Section 3.1.4 of the new main XQuery specification says:

    A function does not inherit a focus (context item, context
    position, and context size) from the environment of the function
    call. During evaluation of a function body, the focus is undefined,
    except where it is defined by the action of some expression inside
    the function body. Use of an expression that depends on the focus
    when the focus is undefined results in a dynamic error.

Why a dynamic error?  It seems like this could and should be a static
error:  An expression that depends on the focus is defined iff the
expression appears inside a function definition but not in a predicate.
And there are only a fixed predefined set of "functions" that depend
on the focus, so we can easily detect this error statically.

I put "function" in quotes, because according to this specification an
expression like 'position()' is *not* a function call, but it is rather
a "macro" (syntax) equivalent to '$fs:position'.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/
Received on Saturday, 19 October 2002 08:47:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:56:43 UTC