[xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
ne of the workgroup is available to discuss those cases. Thanks, Wouter -- W.S. Hager Lagua Web Solutions http://lagua.nl -- W.S. Hager Lagua Web Solutions http://lagua.nl ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
1 to array:size($array))[ $array(.) = $value ] > } > > which is hardly a great hardship to write as a user-defined function. > > > Michael Kay > Saxonica > > On 26 Jun 2015, at 12:18, W.S. Hager wrote: > > Hello, > > I've been working with the recent xquery 3.1 im

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
Correction: fn:index-of([1,2,[3,4]], 3) 2015-06-26 14:30 GMT+02:00 W.S. Hager : > Hi Micheal, > > Agreed, it could be implemented as a user-defined function (although this > particular solution currently throws an error in eXist). However, what > bothers me is that fn:index-of(1,

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
ction to do. >> >> If it’s to behave like fn:index-of() then you can write it as >> >> array:index-of($array, $value) { >>(1 to array:size($array))[ $array(.) = $value ] >> } >> >> which is hardly a great hardship to write as a user-defined function. &

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
Ignore my last sentence, I don't want to make this claim. 2015-06-26 16:38 GMT+02:00 W.S. Hager : > On the whole I agree, and I respect the current status quo of the > specification. However, I expect more changes will follow from actually > working with it. IMHO the current disti

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
[[a]] from [a]. So we have arrays that > allow nesting, and sequences where singletons are the same as items, and > the two models are irreconcilable. > > Michael Kay > Saxonica > > -- W.S. Hager Lagua Web Solutions http://lagua.nl ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
Hi Christian, 2015-06-26 17:18 GMT+02:00 Christian Grün : > > > Too late ;) > > Heh. I should have thought before posting, as it was merely a vague intuition. The problem is of course backwards compatibility, as Michael mentioned. As an aside, does anyone know what the formal definition of sequ

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
Sorry, what I meant is: how did sequences come into XPath? Was it borrowed from another system or did it appear first in XPath? 2015-06-26 17:29 GMT+02:00 G. Ken Holman : > At 2015-06-26 17:23 +0200, W.S. Hager wrote: > >> As an aside, does anyone know what the formal definition of

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
Indeed! Thanks David. 2015-06-26 17:52 GMT+02:00 David Carlisle : > On 26/06/2015 16:33, W.S. Hager wrote: > >> Sorry, what I meant is: how did sequences come into XPath? Was it >> borrowed from another system or did it appear first in XPath? >> > > It's a mo

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
ced by both functional > programming AND databases, was also Michael Rys (Microsoft). > > He was also fundamental in this decision, and many other afterwards. > > HTH, > Dana > > > -- W.S. Hager Lagua Web Solutions http://lagua.nl ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
arser was written by me and James > (both bitching about the “features” in other’s side..:-) > > But overall, I think XSLT and XQuery ended up integrated pretty nicely, so > it was worth the effort. > > Best regards > Dana > > > > > >

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
I meant *the lack of* array:index-of(), obviously. 2015-06-26 19:32 GMT+02:00 W.S. Hager : > That should provide some positive perspectives for integrating with the > web... wait, did I just get off-topic? Oops? No. I write a great deal of > javascript, and this is actually why I woul

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
ML. > > JSON and Javascript are not that….unfortunately. > > XML and JSON communities are like water and oil…. > > So, who would like to be considered BY !?? > > (I wish I knew the answer to that question …) > > Best regards > Dana > > > > > -- W.S. Hager Lagua Web Solutions http://lagua.nl ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-26 Thread W.S. Hager
Perhaps I should underline that I don't find these "inconsistencies" very problematic. It's not javascript, and the language has been spectacularly enriched by these function types. I'm sure it'll be fine without the conviences I suggested. Thanks. 2015-06-26 23:3

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-28 Thread W.S. Hager
dy been motivated and > discussed in the group before. > > Talking about conditions: An if expression without 'else' branch would > often be nice as well (if not present, an empty sequence could be > returned). > > > > On 26 June 2015 at 12:18, W.S. Hager wro

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-28 Thread W.S. Hager
One more consideration: function calls seem to be more expensive than inline expressions. And then there's that baggage of a custom library... 2015-06-28 14:35 GMT+02:00 W.S. Hager : > Hmm, I'm not so sure. The if/else clause is pretty short as it is, and > semantically more

Re: [xquery-talk] xquery 3.1 wishlist

2015-06-28 Thread W.S. Hager
Sorry, I didn't mention I was thinking about the case where I would create a library module instead of using inline functions. 2015-06-28 21:01 GMT+02:00 Michael Kay : > > > On 28 Jun 2015, at 19:32, W.S. Hager wrote: > > > > One more consideration: function calls seem

[xquery-talk] import module

2015-11-13 Thread W.S. Hager
Hi, Why is it "import module" and not "import"? Can something other then a module be imported? Thanks, Wouter -- W.S. Hager Lagua Web Solutions http://lagua.nl ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] import module

2015-11-13 Thread W.S. Hager
Ah, I found it: import schema. Nevermind. 2015-11-13 11:45 GMT+01:00 W.S. Hager : > Hi, > > Why is it "import module" and not "import"? Can something other then a > module be imported? > > Thanks, > Wouter > > -- > > W.S. Hager > Lagua We

[xquery-talk] DOM level 4

2015-12-01 Thread W.S. Hager
Hi, Perhaps this is not the place to discuss this, but I was quite surprised when I stumbled upon the current DOM level 4 spec, which deprecates 4 node types in respect to XML DOM. Are these changes expected to affect XML DOM implementations? Thanks. -- W.S. Hager Lagua Web Solutions http

Re: [xquery-talk] DOM level 4

2015-12-01 Thread W.S. Hager
Thanks. 2015-12-01 16:50 GMT+01:00 Michael Kay : > > > On 1 Dec 2015, at 13:32, W.S. Hager wrote: > > > > Hi, > > > > Perhaps this is not the place to discuss this > > Indeed. I can't see any particular relevance to XQuery. > > > > , but I

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-26 Thread W.S. Hager
g.uk > ___________ > talk@x-query.com > http://x-query.com/mailman/listinfo/talk > -- W.S. Hager Lagua Web Solutions http://lagua.nl ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-26 Thread W.S. Hager
etter : > Any chance you could offer me an example? ;-) > > On 26 January 2016 at 16:40, W.S. Hager wrote: > > Hi Adam, > > > > Perhaps it helps to start with rewriting the xpath expressions as pure > > lambda expressions. Maybe that way you could apply lambda calculus? &

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-26 Thread W.S. Hager
Hi Adam, I'm looking at the formal specification of xpath/xquery: http://www.w3.org/TR/xquery-semantics It would really help to start with a function that implements the actual selection in steps. Do you know such a function? Thanks, Wouter Op dinsdag 26 januari 2016 heeft W.S. Hager

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-26 Thread W.S. Hager
Here's the entry on steps: http://www.w3.org/TR/xquery-semantics/#id-axis-steps I missed it before. To be continued I guess. I'd love the idea of a sound formal proof. Op dinsdag 26 januari 2016 heeft W.S. Hager het volgende geschreven: > Hi Adam, > > I'm looking at

[xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
ong > run, and enables them to get papers published in the academic literature, > it is totally useless to practical engineeers who want to know whether they > can safely rely on C. > > Michael Kay > Saxonica > > > > -- W.S. Hager Lagua Web Solutions http://lagua.nl

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
esults that automatically hold > for the full specification, even though they are > proved on a clean and easy-to-use subset: undecidability and > np-completeness or np-hardness for instance. > > For the full specifications its sometimes hard to grasp the semantics, so > proving anything seri

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
Isn't the constraint in this case the test: is p2 a subset of p1? 2016-01-27 11:04 GMT+01:00 Pavel Velikhov : > > > On 27 Jan 2016, at 12:54, W.S. Hager wrote: > > > > Can't we formally proof something as obvious Adam's case? > > In Adam’s case

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
Or simplified: is the set selected by p1 equal to the set selected by p2? 2016-01-27 11:09 GMT+01:00 W.S. Hager : > Isn't the constraint in this case the test: is p2 a subset of p1? > > 2016-01-27 11:04 GMT+01:00 Pavel Velikhov : > >> >> > On 27 Jan 2

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
e the halting problem of Turing machines to this test. > > > 2016-01-27 11:09 GMT+01:00 W.S. Hager : > >> Isn't the constraint in this case the test: is p2 a subset of p1? >> >> 2016-01-27 11:04 GMT+01:00 Pavel Velikhov : >> >>> >>>

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
gt; >> >> >> Or simplified: is the set selected by p1 equal to the set selected by p2? >> >> >> If we allow p1 and p2 to be arbitrary XQuery path expressions, then its >> undecidable. >> I can reduce the halting problem of Turing machines to this test.

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
XQuery expression language is Turing complete > 3. Subsumption for a Turing complete language is undecidable. > > Well, I can hardly see a way to decide this problem other then by > introducing SOME restrictions > of some sort… but of course some restrictions that would not nullify th

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-27 Thread W.S. Hager
gt; 2. XQuery expression language is Turing complete > >> 3. Subsumption for a Turing complete language is undecidable. > >> > >> Well, I can hardly see a way to decide this problem other then by > >> introducing SOME restrictions > >> of some sort…

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-01-28 Thread W.S. Hager
mitations)? > > Yes. > > > Or just that one case? > > No I want to cover any case where the set which would be selected by > the path expression is statically known (i.e. no function calls). > > > > -- > Adam Retter > > skype: adam.retter > tweet: adamr

[xquery-talk] Function for determining one XPath as subset of another

2016-01-29 Thread W.S. Hager
nuari 2016 heeft Pavel Velikhov het volgende geschreven: > Hmm.. testing subsumption is not as trivial as I thought. Here's a cleaner > way to do it: represent both path expressions as DFAs and then test > subsumption. You'll get DFAs A and B and then test if minimized(B-A) is

Re: [xquery-talk] Function for determining one XPath as subset of another

2016-02-01 Thread W.S. Hager
iry. > > > On 29 Jan 2016, at 20:53, W.S. Hager wrote: > > This is the best I (actually Google) can do. > > Proof: > https://coq.inria.fr/library/Coq.MSets.MSetGenTree.html > > Test: > > > http://www.geeksforgeeks.org/check-if-a-binary-tree-is-subtree-of-an

[xquery-talk] function declaration vs expression

2016-03-14 Thread W.S. Hager
Hello, What is the difference between a function declaration and a function expression in a variable declaration, eg: declare variable $local:id := function($x) { $x } and why does it exist? -- W.S. Hager Lagua Web Solutions http://lagua.nl

Re: [xquery-talk] function declaration vs expression

2016-03-14 Thread W.S. Hager
of a > variable at runtime, however, you will need to use inline function > expressions. Variables in scope will be added to the closure of the > created function item. > > I hope it helps! > > Kind regards, > Ghislain > > On Mon, Mar 14, 2016 at 2:48 PM, W.S. Hager &

Re: [xquery-talk] Unusual XPath syntax question

2016-10-31 Thread W.S. Hager
I just love to do .[1][1][1][1][1][1][1] Op 31 okt. 2016 19:19 schreef "Michael Kay" : > I agree with the other respondents: apart from giving an error if the > context item is not a node, "./." is precisely equivalent to ".". > > (Not sure why an XSLT question is appearing on the XQuery list...)

[xquery-talk] Fold-right

2017-01-12 Thread W.S. Hager
Hello, Not sure if anyone already noticed, but there's an error in the XPath/XQuery F&O docs, where the example implementation of array:fold will always return an array... More importantly, it seems to me that a textbook implementation of fold-right was used, without the notice that this will onl

Re: [xquery-talk] Fold-right

2017-01-12 Thread W.S. Hager
Hello Michael, 2017-01-12 14:09 GMT+01:00 Michael Kay : > Logged here as a bug: > > https://www.w3.org/Bugs/Public/show_bug.cgi?id=30045 Thanks, will do it next time. No, I think the subsequent points are far less important. The code used to > specify the effect of the function is intended to

Re: [xquery-talk] Fold-right

2017-01-12 Thread W.S. Hager
why it's preferable > to have a syntax without an implementation, and I simply pointed out that > in the case of the fold-right example that becomes slightly odd... > > -- W.S. Hager Lagua Web Solutions http://lagua.nl ___ talk@x-query.com http://x-query.com/mailman/listinfo/talk

Re: [xquery-talk] Fold-right

2017-01-12 Thread W.S. Hager
Better still, remove fold-right entirely, since laziness isn't part of the spec (specifically infinite lists). 2017-01-12 18:10 GMT+01:00 W.S. Hager : > Can we please agree to add a footnote to the fold-right example that says > something along the lines of "this example

Re: [xquery-talk] From map entry pairs to a pair of arrays

2017-07-15 Thread W.S. Hager
Hi Joe, In addition to other comments: also the size of the data matters, and not to mention the purpose of what you're trying to achieve... Small chunks are usually processed faster, so unless you just need to convert all data, perhaps limiting the set could be useful. Especially when you need ye

Re: [xquery-talk] From map entry pairs to a pair of arrays

2017-07-16 Thread W.S. Hager
Fact of the matter is that if a low level optimization can be made, it must be made outside of XQuery. I assume it happens all the time. But sure, it depends on the use case. Op 15 jul. 2017 22:47 schreef "Michael Kay" : > > Obviously this operation could be implemented in the host language to ma

Re: [xquery-talk] From map entry pairs to a pair of arrays

2017-07-16 Thread W.S. Hager
an C). Did you come across particular use cases in which it turned out that XQuery maps and arrays were not the best choice? What do you believe was the critical factor (memory consumption, runtime, …)? Cheers, Christian On Sun, Jul 16, 2017 at 12:08 PM, W.S. Hager wrote: > Fact of the matter

Re: [xquery-talk] From map entry pairs to a pair of arrays

2017-07-17 Thread W.S. Hager
What I meant is that the cost of immutability can be avoided in some cases. That's primarily a matter of low level short-circuiting, not so much of writing something new. I don't know if this can be done in Java, I know the Clojure compiler does this, and I'm not aware of XQ engines that do transie

[xquery-talk] arrow operator

2017-08-01 Thread W.S. Hager
Hi, Is there any advantage to using the 3.1 arrow operator over the simple map operator? $string => upper-case() => normalize-unicode() => tokenize("\s+") versus $string ! upper-case(.) ! normalize-unicode(.) ! tokenize(.,"\s+") Thanks, Wouter ___ ta

Re: [xquery-talk] arrow operator

2017-08-02 Thread W.S. Hager
; changes the context item, so @address => replace(@postcode, "", "q") works, while @address ! replace(@postcode, "", "q") doesn't. Michael Kay Saxonica > On 1 Aug 2017, at 13:27, W.S. Hager wrote: > > Hi, > > Is there any advantage

Re: [xquery-talk] arrow operator

2017-08-02 Thread W.S. Hager
tem :) > > @address ! string() (: context item passed implicitly to string#0, which > is context-dependent) > > @address => string() (: context item passed implicitly to string#1 via > the => operator, but string#1 is context-independent) > > > > I hope I got it right!

Re: [xquery-talk] arrow operator

2017-08-02 Thread W.S. Hager
That's why, for cases where it's possible, I preferred to write the simple mapping operator, as it's easier to read IMO. 2017-08-02 12:07 GMT+02:00 W.S. Hager : > Hi Ghislain, > > Alright, I forgot about fn:replace#4, but the implicit binding is > sometimes hard to det

Re: [xquery-talk] arrow operator

2017-08-02 Thread W.S. Hager
y => array:remove($position) => array:insert-before($position, > $member) > > Kind regards, > Ghislain > > [1] https://www.w3.org/TR/xpath-functions-31/ > > > > On 2 Aug 2017, at 12:09, W.S. Hager wrote: > > > > That's why, for cases where it&

Re: [xquery-talk] arrow operator

2017-08-02 Thread W.S. Hager
To be precise, I think it means that the context needs to be bound to the result of the left side of the arrow, but perhaps that isn't even possible. Anyway, the convention seems to me just as trivial as binding the first argument. 2017-08-02 16:17 GMT+02:00 W.S. Hager : > Dear

Re: [xquery-talk] arrow operator

2017-08-02 Thread W.S. Hager
Why can't the context contain a sequence? 2017-08-02 16:31 GMT+02:00 Ghislain Fourny : > Dear Wouter, > > I see your point and it makes sense. The tricky part here, following up on > your suggestion to make the choice of the first position less arbitrary, is > that the context item must be an it

Re: [xquery-talk] arrow operator

2017-08-03 Thread W.S. Hager
Hi Michael, Anonymous functions would've been quite nice, but could your example only be used for a single argument? Op 2 aug. 2017 17:44 schreef "Michael Kay" : > > To put things in perspective, => was introduced in version 3.1, together with map and array support. As far as I understand it and

Re: [xquery-talk] arrow operator

2017-08-04 Thread W.S. Hager
I see, thanks. Op 3 aug. 2017 23:01 schreef "Michael Kay" : > > > > Anonymous functions would've been quite nice, but could your example > only be used for a single argument? > > Yes. I think that's such a common case that it's worth having special > syntax for, particularly as we already have ".

Re: [xquery-talk] What is XQuery?

2018-03-05 Thread W.S. Hager
Hi all, Please note that all your replies landed in spam... Op 4 mrt. 2018 16:26 schreef "Joe Wicentowski" : > Hi all, > > Thanks for these links! I've adapted many of these into the Learn XQuery > list that I maintain: > > https://github.com/joewiz/learn-xquery > > From the description: "A l