Changes

Jump to navigation Jump to search
305 bytes added ,  14:56, 31 October 2023
no edit summary
==BaseX Pragmas==
{{Announce|Updated with Version 11}}: Renamed from {{Code|non-deterministic}} to {{Code|nondeterministic}}. Many optimizations in BaseX will only be performed if an expression is ''deterministic'' (i. e., if it always yields the same output and does not have side effects). By flagging an expression as non-deterministicnondeterministic, optimizations and query rewritings can be suppressed:
<syntaxhighlight lang="xquery">
sum( (# basex:non-deterministic nondeterministic #) {
1 to 100000000
})
In analogy with option declarations and pragmas, locks can also set via annotations. See [[Transaction Management#Annotations|Transaction Management]] for details and examples.
=NonNondeterminism= {{Announce|Updated with Version 11}}: Renamed from {{Code|non-Determinism=deterministic}} to {{Code|nondeterministic}}.
In [https://www.w3.org/TR/xpath-functions-31/#dt-deterministic XQuery], ''deterministic'' functions are “guaranteed to produce ·identical· results from repeated calls within a single ·execution scope· if the explicit and implicit arguments are identical”. In BaseX, many extension functions are non-deterministic nondeterministic or side-effecting. If an expression is internally flagged as non-deterministicnondeterministic, various optimizations that might change their execution order will not be applied.
<syntaxhighlight lang="xquery">
</syntaxhighlight>
In some cases, functions may contain non-deterministic nondeterministic code, but the query compiler may not be able to detect this statically. See the following example:
<syntaxhighlight lang="xquery">
for $read in (file:read-text#1, file:read-binary#1)
let $ignored := non-deterministic nondeterministic $read('input.file')
return ()
</syntaxhighlight>
Two non-deterministic nondeterministic functions will be bound to <code>$read</code>, and the result of the function call will be bound to <code>$ignored</code>. As the variable is not referenced in the subsequent code, the let clause would usually be discarded by the compiler. In the given query, however, execution will be enforced because of the BaseX-specific {{Code|non-deterministicnondeterministic}} keyword.
=Namespaces=
=Changelog=
 
;Version 11:
 
* Updated: Renamed from {{Code|non-deterministic}} to {{Code|nondeterministic}}.
;Version 9.1:
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu