Re: [basex-talk] Working With Maps Using FLOWR Expressions?

2015-04-19 Thread Leonard Wörteler
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

Re: [basex-talk] Working With Maps Using FLOWR Expressions?

2015-04-18 Thread Andy Bunce
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,

[basex-talk] Working With Maps Using FLOWR Expressions?

2015-04-18 Thread Eliot Kimber
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

Re: [basex-talk] Working With Maps Using FLOWR Expressions?

2015-04-18 Thread Eliot Kimber
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