Okay I see what you are getting at but in light of the fact that there is not a set type, but there is an array type, could you not just use the array type with the XPath 3.1 function arrays:for-each?
Regards polluting your code, you would only have that if you chose to access the array by index, instead you could just stick to for-each. Well, I see an array as a specialized dataSet. > > I see an array is an indexed, c.q. subscripted, dataset. > > Or I see a dataset is an array without the indexing-mechanism. > > Or you could also see a dataset as an map without the mapping-mechanism. > > What remains is a dynamic set with data-items where the items can > individually be processed, e.g. by a for-each function, but not > individually be addressed. > > > > Using arrays as datasets pollutes my code with its addressing mechanism. > > Especially for a function language expressiveness of the language should > be one of the highest goods. > > > > Rob > > > > *Van:* Adam Retter [mailto:[email protected]] > *Verzonden:* zondag 19 juli 2015 12:02 > *Aan:* Rob Stapper > *CC:* [email protected] > *Onderwerp:* Re: [xquery-talk] set as datatype in xquery > > > > Can you tell me how you see a dataSet being different to an array? > > > > On 19 July 2015 at 10:27, Rob Stapper <[email protected]> wrote: > > Hello, > > > > Is it an option to add a “dataSet” as datatype in xquery, like for example > the “array”? > > My case is that I’m having this high-order function that iterates through > a sequence and start a given function on each item until it receives back > an ‘nothing’, than it breaks off. > > This works great except with sequences which I ( have to) use for > “dataSets”: there are occasions that I need to return an empty set without > breaking of the iteration. > > In xquery there are empty arrays, empty maps and empty elements but no > empty “dataset”, like - set {} - > > > > Thanx, > > > > Rob Stapper > > > > PS. > > - definition for “dataset” could be something like: - a datatype > representing a dynamic collection of data-items –. > > > > - Since the “dataSet” is an datatype, “dataSets” could hold other dataSets. > > - Function “for-each” ( no particular sequence) could take a “dataset” > but “fold-left” and “fold-right” ( particular sequence) could not. > > - I don’t know if a “fold”-function ( no particular sequence) would make > sense, haven’t thought about it enough. > > > > > ------------------------------ > > [image: Afbeelding verwijderd door afzender. Avast logo] > <https://www.avast.com/antivirus> > > Dit e-mailbericht is gecontroleerd op virussen met Avast > antivirussoftware. > www.avast.com <https://www.avast.com/antivirus> > > > > > _______________________________________________ > [email protected] > http://x-query.com/mailman/listinfo/talk > > > > > -- > > Adam Retter > > skype: adam.retter > tweet: adamretter > http://www.adamretter.org.uk > > > ------------------------------ > [image: Avast logo] <https://www.avast.com/antivirus> > > Dit e-mailbericht is gecontroleerd op virussen met Avast > antivirussoftware. > www.avast.com <https://www.avast.com/antivirus> > > -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk
_______________________________________________ [email protected] http://x-query.com/mailman/listinfo/talk
