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

[Bug 8662] [XQuery 1.1] Need an easy way to define a recursive inline function

From: <bugzilla@wiggum.w3.org>
Date: Thu, 07 Jan 2010 12:50:48 +0000
To: public-qt-comments@w3.org
Message-Id: <E1NSrpA-0003fF-5E@wiggum.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=8662


Michael Kay <mike@saxonica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike@saxonica.com




--- Comment #4 from Michael Kay <mike@saxonica.com>  2010-01-07 12:50:47 ---
>declare variable $f := 1, $f;

I think it would be a very bad idea to do this, because it would force a
processor to use lazy evaluation as its only strategy. This would prevent, for
example, eagerly building an index over a sequence when the processor can see
that there are repeated filter requests on the sequence. It would also be a
fertile source of hard-to-diagnose user errors.

As for the general requirement, I'm not convinced that the value of the
requested feature justifies the complexity of any of the solutions proposed so
far. In the vast majority of cases, it's possible to write the function as a
global named function. The exception is when the function accesses local
variables external to itself; and it's easy enough to work around that by
adding parameters to the global function.

But if we do decide to provide the feature, I think my preferred solution would
be that within an inline function (or perhaps within any function body), a
variable $fn:self should be implicitly bound, its value being the function that
is being defined.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 7 January 2010 12:50:49 UTC

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