[Bug 11547] [XQuery3] Scope of try-catch.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11547

Michael Kay <mike@saxonica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike@saxonica.com

--- Comment #1 from Michael Kay <mike@saxonica.com> 2010-12-14 13:08:10 UTC ---
To do this properly we need to introduce a more rigorous model of expression
evaluation. This is long overdue.

I think we can start with something like this:

The dynamic evaluation of an expression can be represented as a tree, in which
the evaluation of one expression E is considered to *cause* the evaluation of
zero or more expressions F, G, H... Evaluation of an expression normally causes
the evaluation of its lexically contained subexpressions (though it does not
necessarily cause all contained subexpressions to be evaluated, for example in
the case of a conditional expression). If E is a function call, then evaluation
of E causes evaluation of the body of the function being called: this is the
one case where evaluation of one expression causes another expression that is
not lexically a subexpression to be evaluated. If E is a variable reference,
then evaluation of E does not cause evaluation of the initializer for the
variable; that is considered to have been caused by the evaluation of the
variable binding expression, or in the case of a global variable, to have been
caused directly by execution of the query as a whole. 

This relationship (whereby evaluation of E causes evaluation of F) is a formal
one and does not necessarily reflect the actual implementation; techniques such
as lazy evaluation might mean that evaluation of an expression is deferred
until the value is required, but the expression that consumes the result of an
expression D is not considered in this sense to be the cause of D's evaluation.

If evaluation of an expression fails with a dynamic error, then the evaluation
of its causing expression also fails, and so on recursively, unless the causing
expression is a try/catch expression that catches the error in question.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 14 December 2010 13:08:14 UTC