W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2014

[Bug 25445] New: [XP3.1] Replace curly array constructor with a function

From: <bugzilla@jessica.w3.org>
Date: Thu, 24 Apr 2014 22:03:15 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-25445-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25445

            Bug ID: 25445
           Summary: [XP3.1] Replace curly array constructor with a
                    function
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 3.1
          Assignee: jonathan.robie@gmail.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org

Semantically, array { X } is a pure function of X. I can't see any good reason
why it needs special syntax; it should be a function call.

We have used curly brace syntax traditionally for things that are too complex
to express as functions. This one isn't. It converts a sequence to an array;
the inverse operation, to convert an array to a sequence, is a function.

There is no other case where we have used curly braces for something that is a
simple non-higher-order function.

With the syntax growing it's becoming increasingly difficult to remember where
to use curlies and where to use parens. For things like typeswitch I have to
look it up every time. So let's avoid new syntax where we don't need it, and
lets avoid making the two parallel operations array() and seq() different.

Plus, using functions in a functional language has obvious benefits.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Thursday, 24 April 2014 22:03:17 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:55 UTC