Re: [xsl] New XSLT 3.0 Working Draft

Subject: Re: [xsl] New XSLT 3.0 Working Draft
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 11 Jul 2012 09:42:34 +0100
>Might it not be a tad confusing to call them Maps given the support for higher order functions.

Possibly. Especially for folks who know them as dictionaries, or as hashes, or as associative arrays, or (heaven forbid) as "objects". If terminology is the only problem, then we've done well.
- Higher-order functions -

More an XPath feature than an XSLT one, functions are now first-class values
and can be passed as parameters to functions, returned by functions, held in
maps, etc etc.

Given the way unsupplied parameters are currently treated will we have
  partial evaluation ?
Yes, partial evaluation is available. For example:

<xsl:variable name="f" as="function(xs:string) as xs:boolean" select="contains(?, 'a')"/>
<xsl:if test="$f('abracadabra')">...</xsl:if>


returns true

Will we have closures?
yes, closures are available.

Will tunneled variables form part of the environment?

Tunnel parameters are available to templates but not directly to functions. But if a function is declared within a template, the template parameters form part of the function's closure just like any other variable (whether they are tunnel parameters or not). Memo to self: test this!

Michael Kay
Saxonica

Current Thread