W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2016

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

From: <bugzilla@jessica.w3.org>
Date: Sun, 15 May 2016 19:08:55 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29628-523@http.www.w3.org/Bugs/Public/>
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

This archive was generated by hypermail 2.3.1 : Sunday, 15 May 2016 19:08:58 UTC