Created
July 26, 2020 13:28
-
-
Save emchateau/8a4647f1afdca629ad94eca5fb3c40b1 to your computer and use it in GitHub Desktop.
Compare order of two sequences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: https://codereview.stackexchange.com/questions/214571/xquery-compare-order-of-two-sequences :) | |
declare function local:testOrder2($baseSequence, $testSequence) { | |
let $positions := $testSequence ! index-of($baseSequence, .) | |
return min(for $pos at $index in tail($positions) return $pos - $positions[$index]) ge 0 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment