-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
948 Reflected the comments of the CG on the specification of scan-left and scan-right #978
Conversation
The CG also discussed the inconsistency between the summary descriptions of
These versions are a bit shorter and I think clearer than what currently exists. Versions for right would switch to "right to left". |
Definitely better than what's there at the moment, but I think an improvement might be
|
Related (#864 (comment)), I wonder if the current notes could be rewritten as well. I have a hard time to understand the following sentence:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m adding a reference to Joel’s comment in the original issue. It contains some more observations that I think should still be addressed (such as the unification of the two pseudo-codes; using the same variable names as in the function signature; etc.): #957 (comment).
And a minor typo: A space is missing twice in “XPath(return”.
It is beyond the scope of the work on I will take care of using the same variable names...
and of the missing spaces. |
That's the comment I referred to, which I agree with:
|
We agree to disagree. The single, pure XPath runnable code has important advantages over providing two different pseudocode instances - one for XQuery and one for XSLT. I will open a separate issue that we need to improve this situation and have for the pseudo-code of all functions just one, XPath implementation provided. |
There is no such text in the Notes of the two functions. Probably this was referring to something outside of the scope of the current text? |
We are lucky that a common expression language exists for both XSLT and XQuery and this allows us to provide a single semantics (even a runnable one!) that totally fulfills its only intended goal: to be the Oracle for right and wrong results.
If we saw that the current specification for the |
Exactly. See #864 (comment) |
Then this comment is irrelevant for this PR. |
I didn’t expect you to feel addressed, and to take immediate action; it was a reply to the suggestions made in #978 (comment) and the subsequent comment. |
For your item 1, I look forward to seeing the consensus the CG reaches (#981). For item 2, I think you're going to raise a separate issue, which I think is appropriate, which I look forward to following. I think your item 3 is related to item 2 not 1 (a rule expressed in XPath can be equally flawed). I think you will need to argue, and convince others, that in the specs, when the rules of any XPath function is expressed in terms of code, it should be in terms exclusively of XPath, never XQuery and XSLT. Not that I am unsympathetic. The first time I encountered an XPath function defined in terms of XSLT and XQuery I thought it strange that in places XPath should be defined and therefore dependent upon host languages that themselves depend on XPath.
I'm not offering an argument here, only observing that the XPath approach entails an extra layer of indirection, and lacks the clarity of the XQuery definition. If the CG comes to the consensus that XPath purity overrides clarity, then great, I'll go with that. If they go the other way, I'll go with that too. I would be more frustrated with inconsistency, which is what we currently have. |
I would never be consistent with something that we all saw was wrong and that I consider truly sub-optimal (in terms of precise and correct expressing), and both missing and redundant. I think that the |
@dnovatchev Please avoid suggestive language, or (in the given case) define “we all”. The current function coercions rules have been jointly discussed and approved in our previous meetings; there have already been various GitHub issues referring to these rules in the meanwhile; and at least two implementations exist at the moment (namely, Saxon and BaseX) that successfully invoke functions with a lower arity following exactly these rules.
As you take the implementor view: The presented code could be written in any other language or pseudocode. I as an XQuery implementor wouldn’t care if it was expressed in XSLT as long as it’s concise, complete, and consistent. Pseudocode should generally be simple, cover all edge cases, and steer clear of syntactical intricacies.
For the implementor, this doesn’t solve anything: The implementation of a feature can differ a lot from the presented pseudocode. In particular, for folds, a low-level implementation (either iterative or recursive) looks completely different from the XQuery or XPath solutions. In the given case, XQuery is a bit closer, because there’s no need to explicitly pass along a reference to itself. For the user of the language, the choice for the best representation depends a lot on your preknowledge and personal preferences. I’ve created #1000 for further discussion on this topic. |
The CG agreed to accept this issue at meeting 065. |
Reflected the comments of the CG on the specification of scan-left and scan-right