Re: Extension candidates
John Snelson <[email protected]> Fri, 19 Dec 2008 12:22:23 +0000
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <[email protected]> |
Michael Kay wrote: >> That brings the question: what would be the type of a >> function? If I am right, it would be a new specialized kind >> of item (as nodes are). > > John Snelson did a lot of work on this (with some input from me). Yes, we > had function() as a third kind of item, and then we had a type hierarchy so > that for example function(int)->NCName was a subtype of > function(int)->string. Obviously it's very open-ended how far you go down > this route, and when we're doing it as an extension to the language, rather > than a proposal to extend its core, we need to be less ambitious. Sorry for disappearing from the discussion - I came down with the stomach bug that seems to be going around the UK. For people's interest, I've posted the proposal I wrote for higher order functions in XQuery here: http://snelson.org.uk/~jpcs/higher-order-functions.html As Michael says, it might be appropriate for EXSLT to attempt something simpler than this proposal - but it will hopefully give people something to think about. > Extension types in Saxon (like the type of the result of saxon:function()), > are in fact subtypes of xs:anyAtomic rather than being a third kind of item. > That's largely a matter of implementation convenience, but it simplifies a > lot of the rules. I'm interested in why this make things simpler. I would have thought it would bring up hard problems of how and whether to allow casting, serialization etc. 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