[Bug 29628] New: 16.2.1 fn:for-each - proposal of more succinct rules

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29628

            Bug ID: 29628
           Summary: 16.2.1 fn:for-each - proposal of more succinct rules
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: hrennau@yahoo.de
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

Would it not be simpler, clearer and more intuitive if the equivalent
implementation were defined using the simple map operator:

declare function fn:for-each($seq, $f) {$seq ! $f(.)};

instead of:

declare function fn:for-each($seq, $f) {
  if (fn:empty($seq))
  then ()
  else ($f(fn:head($seq)), fn:for-each(fn:tail($seq), $f))
};

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Sunday, 15 May 2016 19:08:57 UTC