Am 08.04.2020 um 11:05 schrieb Christian Grün:
I see that the code uses MarkLogic’s map module functions, which are based on an implementation of a classical side-effecting and mutable hash map. As real XQuery maps are immutable (i.e., once defined, their contents will never change, see [1]), you may need to use Java bindings and instantiate a Java HashMap [2]. I have rewritten one of the proposed memoize functions, it’s attached.
Sorry for the late reply, I don't find much time to pursue my hobby these days, just wanted to give a head's up, since I am always very happy, when you post some XQuery code to the list :-) Want to say: It hasn't gone unseen and thanks so much!