Re: Reference and First-Class Function

"Vladimir Nesterovsky" <[email protected]> Tue, 16 Dec 2008 19:55:40 +0200
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
>> > 1. Don't you think that ex:call() is overloaded with meanings?
>>
>>   Sorry, I don't understand exactly what you mean.
>
> 1. ex:call() dereferences a reference.
> 2. ex:call() performs a function call.
>
>> > 2. ex:call($function, $arg1, $arg2, ...) assumes variable number
>> > of parameters.
>>
>>   Yes.  I don't like that, but I haven't find any other way.
>>
>> >     An alternative is to define single call syntax:
>> >      ex:function(xs:QName('my:add'));
>> >      ex:call($function, $argument);
>>
>>   But what if your function takes several parameters?
>
> In principle it's enough to support one argument function, taking into
> account that
> $argument can be a reference. That one argument function can forward a 
> call
> to a real
> destination. In fact a pair ($function, $argument) can be thought as a
> function-object.

In fact $function can be just xs:QName.
The pair ($function, $argument) allows to model curry functions,
while types of $function, and $argument can be serialized in some way.
--
Vladimir Nesterovsky
http://www.nesterovsky-bros.com