RE: [F&O] Function for self-evaluation?

We have looked at the function eval(). However, we felt that such a
function adds too much dynamic behaviour, that we cannot request from
every implementation.

It is also a function that has security issues (such as code insertion)
and does not work well with statically typed systems.

Best regards
Michael

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Sarah Wilkin
> Sent: Monday, October 13, 2003 4:56 PM
> To: public-qt-comments@w3.org
> Subject: [F&O] Function for self-evaluation?
> 
> 
> One function we added to our XQuery implementation is eval(), which
> takes a string and evaluates it as an XQuery expression. I'm wondering
> if the working group has considered adding such a function.
> 
> The most obvious use case is a query that needs to be marked up and
> executed later. For example, in the NIST test suite, a test looks
like:
> 	<results>
> 		{fn:boolean(xs:double("-1.7976931348623157E308"))}
> 	</results>
> So an implementor is somehow expected to read in the whole file and
> execute it as XQuery. If eval is supported, the same file can become
> 	<results>
> 		fn:boolean(xs:double("-1.7976931348623157E308"))
> 	</results>
> And the test may be evaluated with XQuery itself:
> 	eval(doc("test.xml")/results/string())
> 
> There are, of course, many other uses. The is not merely a
"convenience
> method" as it could never be written as a user-defined function. Any
> comments are appreciated.
> 
> --Sarah
> 

Received on Monday, 13 October 2003 20:00:58 UTC