W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2014

[Bug 21597] higher-order-functions-068

From: <bugzilla@jessica.w3.org>
Date: Thu, 16 Jan 2014 00:46:55 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-21597-523-SQX8a4Wwhz@http.www.w3.org/Bugs/Public/>

--- 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)" />

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:45 UTC