Hi Eliot,
while Andy's solution using `map:merge($maps)` works great in your
specific case, the general pattern (i.e. updating some local state while
iterating over a sequence) is also implemented in the extremely
versatile higher-order `fn:fold-left($seq, $start, $func)` function [1]
(and
Hi Eliot,
Take a look at map:entry and map:merge[1]
let $map:=map{a:old,x:43}
let $seq:=(a,b)
return map:merge(($map,
for $item in $seq return map:entry($item,somevalue)
))
/Andy
[1] http://docs.basex.org/wiki/Map_Module#map:entry
On 18 April 2015 at 17:20,
I think I'm missing something fundamental but I haven't been able to find
a relevant example of what I'm trying to do. I suspect I'm being derailed
by procedural brain damage.
I have a function that takes as input a map and will return a new map
reflecting updates applied to input map.
The
Of course.
Must be my lack of sleep that kept me from seeing that solution :-)
Cheers,
E.
—
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com
On 4/18/15, 11:43 AM, Andy Bunce bunce.a...@gmail.com wrote:
Hi Eliot,
Take a look at map:entry and map:merge[1]
let
4 matches
Mail list logo