> On 19 Jul 2015, at 22:55, Eliot Kimber <[email protected]> wrote:
>
> Yes, the fold operations are still a bit too clever for my taste--I prefer
> to make my business a logic a little more verbose to clearer, at least to
> me--I don't want to have to think too deeply when I'm programming :-)
>
Although I say it myself, I think the xsl:iterate instruction in XSLT 3.0,
which is essentially syntactic sugar over a fold operation, addresses the
readability problem quite well:
> $newKeys => fold-left($m1, function($key, $map) { $map => map:put($key,
> ($map($key), $obj) })
becomes
<xsl:iterate select=“$newKeys”>
<xsl:param name=“map” select=“$m1”/>
<xsl:on-completion select=“$map”/>
<xsl:next-iteration>
<xsl:with-param name=“map” select=“map:put($map, ., ($map(.), $obj))”/>
</xsl:next-iteration>
</xsl:iterate>
Michael Kay
Saxonica
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk