-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1076 from dizzzz/bugfix/right-fold-fix
Repair fold-right
- Loading branch information
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
xquery version "3.0"; | ||
|
||
module namespace fn="http://exist-db.org/xquery/test/fnfunctions"; | ||
|
||
declare namespace test="http://exist-db.org/xquery/xqsuite"; | ||
|
||
declare | ||
%test:assertEquals(0, 4, 3, 2, 1) | ||
function fn:fold-right() { | ||
let $seq := (1,2,3,4) | ||
return | ||
fold-right ($seq, (0) , function($item as xs:integer, $accu as xs:integer*) { | ||
($accu, $item) | ||
}) | ||
}; | ||
|
This file contains 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