[Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba has been updated. Status: Needs review = Approved For more details, see: https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Voting criteria failed for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 : Votes: {'Approve': 1, 'Pending': 1} -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Stage CommitZorba failed. Check console output at http://jenkins.lambda.nu:8180/job/CommitZorba/277/console to view the results. -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Review: Approve Why are there plain english error messages in there? For example, sequence of more than one item. -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Validation queue starting for the following merge proposals: https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
The proposal to merge lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba has been updated. Status: Approved = Merged For more details, see: https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Validation queue succeeded - proposal merged! -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Why are there plain english error messages in there? For example, sequence of more than one item. Because the original code had them. The raiseError() function is non-trivial and I didn't feel like figuring it out at this point. It should be fixed, I agree. -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
I've implemented TreatIterator::count(), but it's not clear what skip() should do, exactly. Should it just call its' child's skip()? Should it do some other checks? If so, what? The problem is that skip() only reports whether there are *more* left, not how many are left. What if the sequence has 5 elements, you tell it to skip 4, and the quantifier is 1? Is that invalid (because there were originally 5) or valid (because there is now exactly 1 left)? (You can construct similar what if questions for the other quantifiers as well.) -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
[Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Paul J. Lucas has proposed merging lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba. Commit message: Added count() skip() to public Iterator API. Requested reviews: Paul J. Lucas (paul-lucas) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Added count() skip() to public Iterator API. -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. === modified file 'NOTICE.txt' --- NOTICE.txt 2014-01-10 02:36:58 + +++ NOTICE.txt 2014-01-15 03:04:02 + @@ -482,7 +482,8 @@ Copyright: 2000 D. J. Bernstein Website: http://cr.yp.to/ftpparse.html - Commercial use is fine, if you let me know what programs you're using this in. + Commercial use is fine, if you let me know what programs you're + using this in. External libraries used by this project: === modified file 'include/zorba/function.h' --- include/zorba/function.h 2013-08-23 11:15:04 + +++ include/zorba/function.h 2014-01-15 03:04:02 + @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software @@ -30,10 +30,10 @@ /**//** The Function class represents a function that is callable from XQuery code, - and it gives access to the various properties that are specified in the + and it gives access to the various properties that are specified in the declaration of the function within a Prolog. - Instances of Function are returned by the StaticContext::findFunctions() + Instances of Function are returned by the StaticContext::findFunctions() method. To be mopre precise, StaticContext::findFunctions() returns smart pointers to Function objects. These smart pointers must be destroyed before the StaticContext object they were obtained from is destroyed. @@ -45,31 +45,27 @@ class ZORBA_DLL_PUBLIC Function : public SmartObject { public: - /** \brief Destructor - */ - virtual ~Function() {} - /** * @return True if the function is sequential; false otherwise. - */ + */ virtual bool isSequential() const = 0; /** * @return True if the function is updating; false otherwise. - */ + */ virtual bool isUpdating() const = 0; /** * @return True if the function is private; false otherwise. - */ + */ virtual bool isPrivate() const = 0; /** * @return True if the function is deterministic; false otherwise. - */ + */ virtual bool isDeterministic() const = 0; @@ -99,7 +95,7 @@ /** * @return The arity of the function. If the function is variadic (which is - * possible only for builtin functions), the result of this method + * possible only for builtin functions), the result of this method * is non-deterministic. */ virtual size_t @@ -119,7 +115,7 @@ /** * @return True if the function implementation is written in XQuery (or - * equivalently, it is a non-external function with a Prolog + * equivalently, it is a non-external function with a Prolog * declaration); false otherwise */ virtual bool @@ -138,10 +134,10 @@ The ExternalFunction class serves as the base of subclasses that represent the implementation/body of external functions. - Instances of ExternalFunction must provide an evaluate method that serves - as the implementation of the function. During its evaluation, an external - function may or may not need to access the static and/or dynamic context of - the invoking XQuery module. If the function implementation does need to + Instances of ExternalFunction must provide an evaluate method that serves + as the implementation of the function. During its evaluation, an external + function may or may not need to access the static and/or dynamic context of + the invoking XQuery module. If the function implementation does need to access either context, the function is referred to as contextual; otherwise, it is non-contextual. ***/ @@ -150,8 +146,7 @@ public: typedef std::vectorItemSequence* Arguments_t; - public: - virtual ~ExternalFunction() {} + virtual ~ExternalFunction(); /** * @return The namespace URI of the function QName @@ -189,8 +184,6 @@ class ZORBA_DLL_PUBLIC NonContextualExternalFunction : public ExternalFunction { public: - virtual ~NonContextualExternalFunction() {} - virtual ItemSequence_t evaluate(const Arguments_t) const = 0; @@ -201,7 +194,7 @@
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
Review: Approve -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
So this looks right to me, but it doesn't work. ExtFunctionCallIterator::count() never gets called it seems. I did a test like: let $conn := ftp:connect( 127.0.0.1, $options ) let $remote-path := / return fn:count( ftp:list( $conn, $remote-path ) ) That should work, right? -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
The problem is that there is a TreatIterator put in place checking the return type of the function. FnCountIterator id=0x1926410 TreatIterator type=[JSONXQType object] quant=* id=0x191d1e0 ExtFunctionCallIterator id=0x193e380 TreatIterator type=xs:anyURI quant= id=0x191cf20 ExtFunctionCallIterator id=0x191e490 SingletonIterator value=xs:string(127.0.0.1) id=0x1927400/ JSONObjectIterator id=0x19264f0/ /ExtFunctionCallIterator /TreatIterator SingletonIterator value=xs:string(/) id=0x19730c0/ /ExtFunctionCallIterator /TreatIterator /FnCountIterator The TreatIterator doesn't override count and, hence, the count call never gets executed on the ExtFunctionCallIterator. Could you please look at the implementation of the TreatIterator. I don't think this can easily be done but maybe you have an idea. -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp
Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/pub_iter_imp into lp:zorba
It depends on what the semantics of fn:count() are, i.e., is is supposed to do the type checks that TreatIterator::nextImpl() does? If the point of the count optimization is not to materialize the objects, then you (obviously) can't do type checks. But is that legal? However, I think (correct me if I'm wrong) that the presence of fn:count() wrapped around an expression changes what the expected type is (to xs:integer) and it also makes the quantization checks irrelevant since fn:count() works on any length sequence. If that's true, then TreatIterator::count() would simply call its child's count without any other checks. I think the same would be true for skip(). -- https://code.launchpad.net/~zorba-coders/zorba/pub_iter_imp/+merge/201708 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp