Hi Rob, Am 01.03.2014 17:53, schrieb Rob Stapper:
The enclosed example triggers stackoverflow-errror. I was wandering if it is a bug.
yes, this definitely is a bug in the compiler. The function item `$go` is inlined even though it is (kind of) recursive, which leads to an infinite loop. I already have a fix for this lying around but I didn't finalize it yet because I didn't think you could produce these loops in XQuery. I raised an issue on GitHub [1] and will submit the fix as soon as possible. Thank you for reporting it!
The $go($go, ….) construction is inspired from Leo Wörteler’s xq-modules: “https://github.com/LeoWoerteler/xq-modules”.
Thanks for looking at those, I hope you like them! Leo [1] https://github.com/BaseXdb/basex/issues/879