[Bug 21597] higher-order-functions-068

https://www.w3.org/Bugs/Public/show_bug.cgi?id=21597

--- Comment #2 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
I just ran the example from my last comment against our processor and it
returns the expected result, which leads me to conclude that it is written
correctly. I also fixed the version in the test (using variables for the CPS
functions) and like Michael said, the return type was incorrect (though it's
incorrect on the anonymous functions, not on the stylesheet function).

The new function signature is as follows:

<xsl:function name="f:fib">
    <xsl:param name="n" as="xs:integer" />
    <xsl:param name="countfun" as="function(xs:integer) as xs:integer" />

    <xsl:sequence select="
        if ($n = 1 or $n = 2)
        then $countfun(1)
        else let $first :=
                 function($x as xs:integer) as xs:integer
                 {
                    let $second := function($y as xs:integer) as xs:integer
                    {
                        $countfun($x + $y)
                    }
                    return f:fib($n - 2, $second)
                 }
             return f:fib($n - 1, $first)" />
</xsl:function>

I will leave this bug open for the moment to allow others to comment on whether
they agree it is indeed corrected now.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 16 January 2014 00:46:58 UTC