<?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>5596</bug_id>
          
          <creation_ts>2008-04-01 13:26:10 +0000</creation_ts>
          <short_desc>[FS] Missing rule in 7.2.5 The fn:collection?</short_desc>
          <delta_ts>2008-04-30 06:31:37 +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>Formal Semantics 1.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>consider for 1.1</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Mills">tim</reporter>
          <assigned_to name="Michael Dyck">jmdyck</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>19676</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-04-01 13:26:10 +0000</bug_when>
    <thetext>In F&amp;O 15.5.6 (fn:collection) says &quot;If $arg is the empty sequence, the function behaves as if it had been called without an argument&quot;

The static typing rules in FS 7.2.5 should reflect this.  I suspect it should be something along the lines of:

statEnv |-  QName of func expands to (FN-URI,&quot;collection&quot;)
statEnv |-  Implementation-defined default sequence has type Type
statEnv |-  Expr : empty-sequence()
------------------------------------------------------------------
statEnv |-  QName(Expr) : Type</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19949</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-04-26 01:35:24 +0000</bug_when>
    <thetext>As I understand it, the rules of FS 7.2.5 are complete, and consistent with F+O 15.5.6, they just aren&apos;t as precise as they could be in the case where the argument&apos;s static type is empty. So unless that lack of precision causes serious problems, I don&apos;t think I can process this as an erratum. (Note that an implementation is free to infer the more precise type under FS 6.1.1 Static Typing Extensions.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19952</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-04-28 07:21:28 +0000</bug_when>
    <thetext>That&apos;s a shame.  We do of course implement this rule.  Might it be considered as a feature request for XQuery 1.1 FS?

It seems unfortunate that fn:collection() and fn:collection( () ) should be typed differently when the behaviour is meant to be the same.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19953</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-04-28 07:44:59 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Might it be considered as a feature request for XQuery 1.1 FS?

Yes, I&apos;ve marked it as &quot;consider for 1.1&quot; in the Status Whiteboard.

&gt; It seems unfortunate that fn:collection() and fn:collection( () ) should be
&gt; typed differently when the behaviour is meant to be the same.

I agree, but I don&apos;t think &quot;unfortunate&quot; warrants an erratum.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19954</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-04-28 07:57:14 +0000</bug_when>
    <thetext>Thanks.  The only argument in favour of adding it as an erratum would be:

&quot;If $arg is the empty sequence, the function behaves as if it had been called without an argument.&quot;

but I don&apos;t think I&apos;d even try to argue that the static type is a part of the behaviour.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19993</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-04-29 22:24:31 +0000</bug_when>
    <thetext>At their meeting today, the WGs approved the response in comment #1, so I am changing this issue&apos;s Severity to &quot;enhancement&quot; and marking it as resolved-WONTFIX (and keeping &quot;consider for 1.1&quot; in the Status Whiteboard). If you accept this resolution, please mark the issue CLOSED.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19995</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-04-30 06:31:37 +0000</bug_when>
    <thetext>Thanks.

I&apos;d like to request that the static typing rules of fn:trace also be considered for 1.1 (Bug 3784).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>