Re: Reference and First-Class Function
"Michael Kay" <[email protected]> Tue, 16 Dec 2008 18:02:59 -0000
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <473CE50B5EB7400A849D8E0FF19FE797@Sealion> |
It seems to me that even if it's syntactic sugar, allowing people to write
call($function, 1, 2, 3)
is a lot more usable than requiring them to write
call(curry(curry(curry($function, 1), 2), 3))
or even
call($function, (ref(1), ref(2), ref(3)))
Michael Kay
http://www.saxonica.com/
> >>
> >> > 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
>
>
>
> _______________________________________________
> exslt mailing list
> [email protected]
> http://www.exslt.org/list