Interesting, thanks. Now that I think about chaining of those "atomic" update expressions I think that it probably conforms better to the functional programming paradigm (which I'm - as an avid Clojure apprentice - not against at all :))
Daniel
-- danielkvasnicka.net
On 22. 11. 2012, at 15:40, Christian Grün christian.gruen@gmail.com wrote:
Hi Daniel,
Doesn't it introduce performance problems though? If you do this copying with some bigger chunk of XML does it take the same amount of memory or is it somehow "delta" optimized?
Yes; this is due to the specification, btw. Whatever you copy in your XQUF spec. is supposed to be cached before it is being evaluated.
Regarding updating operations in closures: the current version of the spec. disallows updating operations, because it cannot be statically determined if a dynamic function invocation is an updating expression or not. See [1] for more details.
Best, Christian
[1] http://www.w3.org/TR/xquery-update-30/#id-dynamic-function-invocation