Xquery updating function

I'm wondering if there is really no way to reliable update a variable?Maybe I'm just to used to those things in other languages, but I can't really imagine / believe it ;-) [1] second paragraph below the screenshots of the chapter "L is for LET" UPDATE: I have to add a question to this: Shouldn't it be possible to update an existing variable in an if statement because in this case the order of execution is clear?This cacheability is a central feature of the functional approach.It creates the potential for highly efficient interpreters to be written, but it requires you to think recursively if you want to be able to operate with mutable values. If you can't rely on the order of execution, how would doing so make sense anyways?

Just like in any other functional language you can always ensure you "eval" your "expr" and then make the required changes with a copy.

Note that if you use update statements on a document stored in a whole document container, then you might lose some of your document's formatting.

This is because update statements reparse the documents they operate upon and then ultimately store them back in the container in the format used for node storage containers.

Whatever patterns are passed as an argument into the recursive call are assigned to $patterns within the new function invocation. writing compilers) recursion is the only model I've found with sufficient power.

Real examples have a tendency of looking even more complicated than the one above, though.

But XQuery isn't that kind of language, it's a declarative language and works at a higher level.

You must have an account to comment. Please register or login here!