|
Implementations | |||||||
Tests | BaseX 8.5 beta XQ31 (QT3 vCVS) |
Saxon-EE 9.7.0.11 XP31 (QT3 v0.6) |
Saxon-EE 9.7.0.11 XQ31 (QT3 v0.6) |
XmlPrime 4.0.0.16079 XP31 (QT3 vCVS) |
XmlPrime 4.0.0.26293 XQ31 (QT3 vCVS) |
XmlPrime 4.0.0.27704 XQX31 (QT3 vCVS) |
|
---|---|---|---|---|---|---|---|
fn-fold-left | 25/26 | 17/17 | 26/26 | 17/17 | 26/26 | 26/0 | 0/6 |
fold-left-001[+]
X fold-left-001: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, 0, function($a, $b) { $a + $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-002[+]
X fold-left-002: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left((2,3,5,7), 1, function($a, $b) { $a * $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-003[+]
X fold-left-003: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left((true(), false(), false()), false(), function($a, $b) { $a or $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-004[+]
X fold-left-004: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left((true(), false(), false()), false(), function($a, $b) { $a and $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-005[+]
X fold-left-005: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, (), function($a, $b) {($b, $a)}) |
pass | pass | pass | pass | pass | pass | |
fold-left-006[+]
X fold-left-006: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, "", fn:concat(?, ".", ?)) |
pass | pass | pass | pass | pass | pass | |
fold-left-007[+]
X fold-left-007: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, "$zero", fn:concat("$f(", ?, ", ", ?, ")")) |
pass | pass | pass | pass | pass | pass | |
fold-left-008[+]
X fold-left-008: Created on: 2010-02-10 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: let $hours := function ($emp as element(employee)) as xs:integer { sum($emp/hours/xs:integer(.)) }, $highest := function ($f as function(item()) as xs:anyAtomicType, $seq as item()*) { fold-left($seq, (), function($highestSoFar as item()*, $this as item()*) as item()* { if (empty($highestSoFar)) then $this else let $thisValue := $f($this), $highestValue := $f($highestSoFar[1]) return if ($thisValue gt $highestValue) then $this else if ($thisValue eq $highestValue) then ($highestSoFar, $this) else $highestSoFar }) } return $highest($hours, /works/employee) |
pass | pass | pass | pass | pass | pass | |
fold-left-009[+]
X fold-left-009: Created on: 2010-02-10 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: declare function local:distinct-nodes-stable($seq as node()*) { fold-left( $seq, (), function($foundSoFar as node()*, $this as node()) as node()* { if ($foundSoFar intersect $this) then $foundSoFar else ($foundSoFar, $this) }) }; let $nodes := (<a/>, <b/>, <c/>, <d/>, <e/>, <f/>) let $perm := ($nodes[1], $nodes[2], $nodes[4], $nodes[1], $nodes[2], $nodes[3], $nodes[2], $nodes[1]) return local:distinct-nodes-stable($perm)/local-name() |
pass | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-010[+]
X fold-left-010: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, 1, function($a, $b, $c){ $a + $b + $c }) |
pass | pass | pass | pass | pass | pass | |
fold-left-011[+]
X fold-left-011: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, 1, function($a, $b) as element(foo) { $a + $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-012[+]
X fold-left-012: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, "", function($a, $b) { $a + $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-013[+]
X fold-left-013: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, 1, function($a, $b as element(foo)) { $a + $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-014[+]
X fold-left-014: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 5, 1, function($a as element(bar), $b) { $a + $b }) |
pass | pass | pass | pass | pass | pass | |
fold-left-015[+]
X fold-left-015: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 2, 1, function($a, $b){ ($a, $b) }) |
pass | pass | pass | pass | pass | pass | |
fold-left-016[+]
X fold-left-016: Created on: 2011-11-27 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: let $html := <html> <body> <div id="main"> <p class="para">Hello World!</p> </div> <p class="para">Goodbye!</p> </body> </html> let $css-selectors := <selectors> <id>main</id> <class>para</class> </selectors>/* let $interpreter := function($ctx, $selector){ typeswitch($selector) case $a as element(id) return $ctx//*[@id = $a/text()] case $a as element(class) return $ctx//*[@class = $a/text()] default return () } let $result := fold-left($css-selectors, $html, $interpreter) return $result/text() |
pass | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-017[+]
X fold-left-017: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 13, 0, concat("(", ?, "+", ?, ")")) |
pass | pass | pass | pass | pass | pass | |
fold-left-018[+]
X fold-left-018: Created on: 2011-11-27 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: let $text := "Peter Piper picked a peck of pickled peppers A peck of pickled peppers Peter Piper picked" let $tokens := tokenize($text, '\s') let $counter := function($result, $word){ let $word-count := $result[@value = $word] return if(empty($word-count)) then ($result, <word value="{$word}" count="1" />) else ( $result except $word-count, <word value="{$word-count/@value}" count="{number($word-count/@count) + 1}" /> ) } let $words := fold-left($tokens, (), $counter) return ( number($words[@value="Peter"]/@count), number($words[@value="Piper"]/@count), number($words[@value="pickled"]/@count) ) |
pass | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-019[+]
X fold-left-019: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left((13, 14, 9, 6), (), function($a, $b){ if(empty($a)) then $b else ($a + $b) div 2 }) |
pass | pass | pass | pass | pass | pass | |
fold-left-020[+]
X fold-left-020: Created on: 2011-11-27 Spec Dependencies: spec = XP30+ XQ30+ feature = higherOrderFunctions Test: fold-left(1 to 1000000, 0, function($a, $b){ $a + 1}) |
pass | pass | pass | pass | pass | pass | |
fold-left-021[+]
X fold-left-021: Created on: 2016-07-20 Spec Dependencies: spec = XQ31+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: declare variable $in := (<doc><A/><B/>{(1 to 10000)!<C/>}<B/><A/></doc>)/*; declare variable $fsm := map{ 0: function($x) {if ($x[self::B]) then 1 else 0}, 1: function($x) {if ($x[self::B]) then 1 else 2}, 2: function($x) {if ($x[self::B]) then 3 else 2}, 3: function($x) {3}}; fold-left($in, 0, function($state, $node){$fsm($state)($node)}) ne 3 |
no result | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-101[+]
X fold-left-101: Created on: 2014-09-07 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: declare function local:fold-left( $seq as item()*, $zero as item()*, $f as function(item()*, item()) as item()*) as item()* { if (fn:empty($seq)) then $zero else fn:fold-left(fn:tail($seq), $f($zero, fn:head($seq)), $f) }; local:fold-left(1 to 5, 0, function($a, $b) { $a + $b }) |
pass | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-102[+]
X fold-left-102: Created on: 2014-09-07 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: declare function local:fold-left( $seq as item()*, $zero as item()*, $f as function(item()*, item()) as item()*) as item()* { if (fn:empty($seq)) then $zero else fn:fold-left(fn:tail($seq), $f($zero, fn:head($seq)), $f) }; local:fold-left((2,3,5,7), 1, function($a, $b) { $a * $b }) |
pass | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-103[+]
X fold-left-103: Created on: 2014-09-07 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: declare function local:fold-left( $seq as item()*, $zero as item()*, $f as function(item()*, item()) as item()*) as item()* { if (fn:empty($seq)) then $zero else fn:fold-left(fn:tail($seq), $f($zero, fn:head($seq)), $f) }; local:fold-left((true(), false(), false()), false(), function($a, $b) { $a or $b }) |
pass | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-104[+]
X fold-left-104: Created on: 2014-09-07 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: declare function local:fold-left( $seq as item()*, $zero as item()*, $f as function(item()*, item()) as item()*) as item()* { if (fn:empty($seq)) then $zero else fn:fold-left(fn:tail($seq), $f($zero, fn:head($seq)), $f) }; local:fold-left((true(), false(), false()), false(), function($a, $b) { $a and $b }) |
pass | n/a
notXP31 |
pass | n/a | pass | pass | |
fold-left-105[+]
X fold-left-105: Created on: 2014-09-07 Spec Dependencies: spec = XQ30+ spec = XP30+ XQ30+ feature = higherOrderFunctions Test: declare function local:fold-left( $seq as item()*, $zero as item()*, $f as function(item()*, item()) as item()*) as item()* { if (fn:empty($seq)) then $zero else fn:fold-left(fn:tail($seq), $f($zero, fn:head($seq)), $f) }; local:fold-left(1 to 5, (), function($a, $b) {($b, $a)}) |
pass | n/a
notXP31 |
pass | n/a | pass | pass |