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 business logic of this function is to iterate over some sequence and
add or update map items as needed, e.g.:

let $map := map { }
for $key in ('A', 'B')
    return map:put($map, 'A', 'somevalue')

The problem is that each interation of the for loop returns a new map.

In the context of a FLOWR expression I'm not seeing how to effectively
update the same map instance.

What fundamental aspect of map manipulation am I missing?

Thanks,

Eliot
—————
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com



Reply via email to