Re: Reference and First-Class Function

John Snelson <[email protected]> Fri, 19 Dec 2008 12:45:25 +0000
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Dimitre Novatchev wrote:
>>> ...
>>> the fact that HOF have been implemented *without* extensions long ago),
>>>   
>> This is quite true for XSLT, but not for XPath or (perhaps more importantly) 
>> XQuery.
> 
> As I said, it is OK for anyone to propose extensions for HOFs (or for anything else).
> 
> What is incorrect is to assume HOFs are a precondition for implementing references.

I'm not sure anyone is assuming that. I think the thought process goes:

o Higher order function support would be good to have.
o Sequence references would be good to have.
o Since HOF closures look a lot like sequence references, if we're going 
to have both we should implement one in terms of the other.

> Anyone could propose to implement HOF via extensions (and it is up to them to defend
> such a proposal given the fact that HOF have been implemented *without* extensions long
> ago)

With respect to everything that you've achieved in FXSL, there's still a 
lot that could be improved on:

1) Syntactic support - not having to define a template and two functions 
for each HOF.

2) Lambda (anonymous) functions.

3) Closures and partial application - FXSL can't handle these completely.

4) Support in the type system - a prerequisite for good optimization.

John

-- 
John Snelson, Oracle Corporation            http://snelson.org.uk/john
Berkeley DB XML:            http://oracle.com/database/berkeley-db/xml
XQilla:                                  http://xqilla.sourceforge.net