<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>10074</bug_id>
          
          <creation_ts>2010-07-03 05:07:35 +0000</creation_ts>
          <short_desc>Missing operator definitions</short_desc>
          <delta_ts>2010-07-13 13:55:09 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>dnovatchev</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36555</commentid>
    <comment_count>0</comment_count>
    <who name="">dnovatchev</who>
    <bug_when>2010-07-03 05:07:35 +0000</bug_when>
    <thetext>In this WD I could not locate a definition for any of the following operators:

op:boolean-or()     -- as in &quot;true() or false()&quot; 

op:boolean-and()    -- as in &quot;true() and false()&quot;

op:location-step()  -- this is the &quot;/&quot; character

op: map-function()  -- this is the &quot;/&quot;character followed by a function call

op:apply-function()  -- this is the &quot;()&quot; operator, which causes a function to be applied.

Defining only some operators and not providing the definitions of other operators is confusing and as a negative consequence may imply to the reader that there is something special about the operators whose definitions are missing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36558</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-03 11:42:42 +0000</bug_when>
    <thetext>You are quite right to point this out: I have always thought it was something of an oddity.

For &quot;and&quot; and &quot;or&quot;, I suspect the original justification was that these operators in XPath 1.0 had short-cut semantics, which means they were not pure functions of their arguments. However, the semantics changed over time and this argument is no longer valid.

For the operators &quot;/&quot;, &quot;[]&quot;, and &quot;()&quot;, the translation into functions produces higher-order functions which could not be represented in the 2.0/1.0 model. They can be represented now, so again this justification has probably disappeared. (But the function-call operator &quot;()&quot; is still a little challenging to describe this way since the number of arguments is unbounded.)

The other side of the coin, however, is to question whether the mechanism of mapping operators to functions really serves any useful didactic purpose. It was quite handy in the early days before we decided which functions should have an operator syntax and which should only be available as function calls, but that&apos;s history.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36559</commentid>
    <comment_count>2</comment_count>
    <who name="">dnovatchev</who>
    <bug_when>2010-07-03 13:47:51 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; The other side of the coin, however, is to question whether the mechanism of
&gt; mapping operators to functions really serves any useful didactic purpose. It
&gt; was quite handy in the early days before we decided which functions should have
&gt; an operator syntax and which should only be available as function calls, but
&gt; that&apos;s history.

This has a much more important aspect than purely historical. Right now it isn&apos;t possible to pass an operator as a parameter or return it as result of a function. This significantly limits the scope of the HOFs in XPath. This issue was raised in bug 7350 among other issues.

I still don&apos;t see any compelling reasons why operators shouldn&apos;t be part of the set of normal HOF functions where they do belong.

Should I file a separate bug for this problem?


Dimitre Novatchev.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36788</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-13 13:19:50 +0000</bug_when>
    <thetext>
WG response:

There are two questions here: 

(a) there is a lack of editorial logic in having underpinning functions for some operators but not others. This is essentially an editorial issue, and at the moment we don&apos;t feel we have the resources to make improvements in this area.

(b) should the op: functions be exposed as a public interface? The WG feeling on this is that if we had intended them as a public interface, we would have designed them differently, and we do not currently see a compelling need for user-visible functions at this level, especially as it is easy for a user to add a function as a wrapper around the operator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36791</commentid>
    <comment_count>4</comment_count>
    <who name="">dnovatchev</who>
    <bug_when>2010-07-13 13:55:09 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; WG response:
&gt; There are two questions here: 
&gt; (a) there is a lack of editorial logic in having underpinning functions for
&gt; some operators but not others. This is essentially an editorial issue, and at
&gt; the moment we don&apos;t feel we have the resources to make improvements in this
&gt; area.
&gt; (b) should the op: functions be exposed as a public interface? The WG feeling
&gt; on this is that if we had intended them as a public interface, we would have
&gt; designed them differently, and we do not currently see a compelling need for
&gt; user-visible functions at this level, especially as it is easy for a user to
&gt; add a function as a wrapper around the operator.

(personal)

I am not satisfied with the decision. This leaves the new, HOF feature limited and not too useful.

Thus there are significant gaps in the document, while at the same time there are proposals for work on relatively minor, not so significant functions.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>