Skip to content
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

982 Editorial rewrite of scan-left and scan-right #1882

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

michaelhkay
Copy link
Contributor

This is intended to be purely an editorial rewrite, it does not change the functionality.

Replaces #1296.

Addresses #982, but we still need to add corresponding functions for arrays.

@michaelhkay michaelhkay added XQFO An issue related to Functions and Operators Editorial Minor typos, wording clarifications, example fixes, etc. labels Mar 16, 2025
</fos:notes>
<fos:equivalent style="xpath-expression">
(0 to count($input))
! [fold-left( subsequence($input, 1, .), $accum, $action )]
Copy link
Contributor

@ChristianGruen ChristianGruen Mar 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an alternative, if we want to avoid the simple map operator:

fold-left($input, [ $accum ], fn($a, $i) {
  $a, [ $action(array:items(foot($a)), $i) ]
})

(Motivation: Your remark on the mailing list that ”we should try to avoid reliance of constructs that don't themselves have a formal equivalent - which includes things like the "!" operator and FLWOR expressions.”).

@ndw
Copy link
Contributor

ndw commented Mar 18, 2025

The CG agreed to merge this PR at meeting 114

@ndw ndw merged commit d87b429 into qt4cg:master Mar 18, 2025
3 checks passed
@michaelhkay michaelhkay added the Tests Needed Tests need to be written or merged label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editorial Minor typos, wording clarifications, example fixes, etc. Tests Needed Tests need to be written or merged XQFO An issue related to Functions and Operators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants