Doc mistake for map:get() for NaN key

Tuesday, 9 June 2015 · 2 messages
AG
Amanda Galtman9 Jun 2015 15:53 #
Hi, I think the following is a mistake in the doc, but before changing the wiki, I wanted to double-check. The documentation for map:get says, "If the supplied key is the xs:float or xs:double value NaN, the function returns an empty sequence." BaseX 8.1 returns the value that corresponds to the NaN key (if present). The software behavior seems correct to me. For example:
INPUT
let $mymap := map:entry(xs:double('NaN'),'abc')
return map:get($mymap,xs:double('NaN'))
OUTPUT abc Thanks, Amanda
CG
Christian Grün9 Jun 2015 16:01 #
Hi Amanda, You are right, our documentation is out-dated. In a recent version of XQuery 3.1, the behavior of map:get and map:contains has been changed, so the current behavior of BaseX is correct. Thanks for updating our Wiki, Christian
Quoted text · Amanda Galtman · 29 lines
On Tue, Jun 9, 2015 at 3:53 PM, Amanda Galtman <Amanda.Galtman at mathworks.com> wrote: > Hi, > > I think the following is a mistake in the doc, but before changing the wiki, > I wanted to double-check. > > The documentation for map:get says, “If the supplied key is the xs:float or > xs:double value NaN, the function returns an empty sequence.” BaseX 8.1 > returns the value that corresponds to the NaN key (if present). The software > behavior seems correct to me. For example: > > INPUT > > let $mymap := map:entry(xs:double('NaN'),'abc') > > return map:get($mymap,xs:double('NaN')) > > > > OUTPUT > > abc > > > > Thanks, > > Amanda

⚡Generated with XQuery