Re: Reference and First-Class Function

"Vladimir Nesterovsky" <[email protected]> Sun, 21 Dec 2008 08:33:16 +0200
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Dimitre,

> So, references do exist in XPath and XSLT, they are held in a
> variables and returned from functions. The only problem is
> whenever we want to store them in an XML document or use a
> reference to a sequence as an atomic item inside another sequence.

An atomic item referencing a sequence inside another sequence
does not exist in the current specs.

I suspect we tacitly call such item as a reference.

What is the type of such item?

It can be proposed type (function() as item()*) - argumentless function 
returning a sequence,
or some other type, encapsulating a sequence.

Both approaches allow to define single API ref(), deref().
Thus the question, in fact, belongs to implementation details.

If inline functions existed how would you implement ref(), deref()?

On the other hand I do not like the idea of ex:partial-apply(), as it's
defined in John's proposal, as it resembles reflection very much.

In absence of inline functions I'd based implementation of references (and 
maps) on external objects.

P.S. If there were typedefs one could conceal the difference even more.
--
Vladimir Nesterovsky
http://www.nesterovsky-bros.com