Hi Florent,
This allows you to omit a FLWOR from your code. Instead of
for $x in (1, 2, 3, 4, 5)
return some-func($x)
you can just write
some-func((1, 2, 3, 4, 5))
A more concrete, real-life example would be
xdmp:document-insert(
$uri, $doc,
(xdmp:permission("owner-role", ("read", "update")),
xdmp:permission(("reader-role1", "reader-role2", "reader-role3"),
"read")))
With function mapping coming in handy for generating the permissions
list.
It's just about writing more succinct code.
Also, if you declare your function to take an optional argument like
"xs:string?" then function mapping will not happen and you'll get an
exception if you pass more than one value.
Wayne.
On Thu, 2008-11-06 at 17:57 +0100, Florent Georges wrote:
Colleen Whitney wrote:
> This is the result of function mapping
I can't find out of the top of my head any use case that this new
feature is intended to solve. And of course, no use case that is worth
adding such a feature that breaks the type checking system.
Did I miss something obvious?
Regards,
------------------------------------------------------------------------
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general