This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29671 - [Fo31] fn:random-number-generator
Summary: [Fo31] fn:random-number-generator
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: https://www.w3.org/XML/Group/qtspecs/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-27 11:29 UTC by Tim Mills
Modified: 2016-07-21 13:56 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2016-05-27 11:29:55 UTC
Can we please change the signature of

fn:random-number-generator($seed	 as xs:anyAtomicType) as map(xs:string, item())

to

fn:random-number-generator($seed	 as xs:anyAtomicType?) as map(xs:string, item())

such that a call of fn:random-number-generate( () ) is equivalent to calling fn:random-number-generator().

in keeping the convention often used in F&O?
Comment 1 Tim Mills 2016-05-27 11:47:54 UTC
On closer inspection, this isn't the convention at all.

Please ignore.
Comment 2 Tim Mills 2016-05-27 11:52:29 UTC
Actually, this does make sense, since it provides a way to use the unary function to "choose a seed that is likely to be different from one execution scope" as per the zero-arity version.
Comment 3 Andrew Coleman 2016-06-10 14:30:19 UTC
At the meeting on 2016-06-07, the WG agreed to resolve this as follows:

RESOLVED: to adopt the proposal in bug 29671 to make
random-number-generator#1 accept an empty sequence as argument, with
the behavior being the same as for random-number-generator#0.

Actions A-645-01 and A-645-02 were raised to track this.
Comment 4 Tim Mills 2016-06-13 08:53:47 UTC
Tests have been added.

I've presumed that the text will make it clear that a call

fn:generate()

is exactly equivalent to a call to

fn:generate( () )

in the sense that they will generate exactly the same random sequence, e.g. such that

fn:generate()?number eq fn:generate( () )?number