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
xquery version "1.0-ml"; | |
(: xquery memoization example for use with MarkLogic :) | |
declare variable $cache := map:map(); | |
declare function local:factorial($n as xs:integer) as xs:integer { | |
if ($n < 0) then | |
(0) | |
else if ($n = 0) then |