W3C home > Mailing lists > Public > www-ql@w3.org > July to September 2004

RE: Evaluation function

From: Stephane Mbaye <stephane.mbaye@gael.fr>
Date: Fri, 23 Jul 2004 16:51:02 +0200
To: "XQuery" <www-ql@w3.org>
Message-ID: <GFEAJGIFEMEPLOOAHLMPIENMCKAA.stephane.mbaye@gael.fr>

Thank you for your answers.

It sounds that an evaluating expression is an interesting issue for many
users and purposes. I understand, however, how complex it could be to
specify this function, and in particular with regard to the conversion of
the dynamic context to the static evaluation context (e.g. should the
(sub-)expression declare, as "external", the variables to inherit from the
outer context? Should the current date time be reinitialized? etc.).

Nevertheless, I am convinced it is not an impossible process and, should an
evaluate() function be specified, it could have very constraining
specifications. As an example, it may be totally independent from the
static/dynamic context of the calling query. It may also have
implementation-defined or implementation- dependent features such as many
other components of the XQuery language.

My concern is at least to have a standardized/common specification/baseline,
to avoid or minimize the number of different implementations of the same

Is the debate completely closed?


-----Message d'origine-----
De : Jonathan Robie [mailto:jonathan.robie@datadirect.com]
Envoye : vendredi 23 juillet 2004 12:04
A : Michael Kay
Cc : 'Stephane Mbaye'; 'XQuery'
Objet : Re: Evaluation function

I was also one of the "one or two of us" who were pushing for this.

Another reason given for delaying is that some people felt second order
functions are more important than eval(), and there is an overlap in the
usage scenarios.

But eval() can do some things second-order functions can't, such as
executing an XQuery expression stored in data.


Michael Kay wrote:

> There is no standard function to do this.
> A number of XSLT processors (Saxon was the first) have provided an
> evaluate() function to fill this gap - there is a semi-standardized
> specification at www.exslt.org <http://www.exslt.org>. Unfortunately
> Saxon's version, saxon:evaluate() is not currently available via the
> XQuery interface, only via XSLT. I don't think there's a good technical
> reason for this restriction, it's mainly a question of testing.
> One or two of us did push quite hard for a standard evaluate() function,
> but the WG decided against. The main arguments, if I recall, were (a)
> that it broke type safety, (b) that some processors use a compilation
> architecture in which the parser isn't available at run-time, and (c)
> that it's not obvious how much of the static/dynamic context should be
> available to the evaluated expression.
> (At least you understand what it is that you're asking for! A lot of
> XSLT users have stumbled into this without knowing what they are doing,
> they try to write things like a[$x] where $x is the string "@foo='bar'"
> I think the problem is that the use of $ to introduce variables is
> associated in some people's minds with macro languages).
> Michael Kay
Received on Friday, 23 July 2004 10:54:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:16 UTC