On Tue, Jul 8, 2008 at 1:55 PM, Jens Teubner
On Tue, Jul 8, 2008 at 5:19 AM, Ying Zhang
wrote: You probably mean PFty_empty().
This might indeed be the type we are looking for, however, in the final generated MIL code, it contains no translation for fn:put() at all. The simplification/optimization steps didn't know that this "senseless" function has some side effect:)
I will try to find where fn:put has been simplified, or maybe Jan already has an idea?
Hi!
empty-sequence() doesn't seem to be the right return type for fn:put().
According to the spec, fn:put has return type empty-seq and it is *not* an update function: http://www.w3.org/TR/xquery-update-10/#id-func-put they call it an extension to the built-in function library (!).
Pathfinder decides the validity of updating expressions slightly different than the W3C specs (and, in my eyes, much more consistent). According to the W3C, updating expressions have the return type empty-sequence() and there are syntactical constraints that prohibit mixtures of updating and non-updating expressions.
According to the (new?) w3c spec, in chapter 3 "Update operations", they say: "Although these update operations are described using a functional notation, they are not true functions because many of them have no return value." And also for each update function listed after they don't have a returning type. I thing they have changed allot of stuff hence the confusion. I don't know what is the correct solution to this mix...
Pathfinder, by contrast, knows an additional type, separate from any other type: statement (accessible via PFty_stmt() or something like that). Correctness of a query is then decided based on types. This should also be the right return type for fn:put().
The W3C specification even seems somewhat contradictory. According to static typing rules, most situations where an expression can statically be determined to yield the empty sequence are actually considered a type error. In consequence, there must not be a function whose return type is empty-sequence(). Pathfinder doesn't strictly implement this part of the static typing feature.
Best regards,
Jens
-- Jens Teubner, jens.teubner@gmail.com
------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users