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

RE: focus over function calls

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Sun, 20 Oct 2002 20:27:43 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E621060453DC9E@daemsg02.software-ag.de>
To: Per Bothner <per@bothner.com>, 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.

Interesting. Yes, many implementations will be able to detect this error
statically. But in the formal semantics we currently have no rules that tell
us which expressions depend on the context item and which don't. The
analysis is not trivial, for example string() depends on the context item,
and I don't think we should try and prescribe it. In cases like this I think
we should allow implementations to raise a static error, but not require it.

Michael Kay
Received on Sunday, 20 October 2002 14:27:53 UTC

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