empty() behaves differently on 7.8.2

Thursday, 8 May 2014 · 4 messages
ML
Marco Lettere8 May 2014 11:42 #
Hello all, I'm pretty puzzled by the following fact. On version 7.8 the following code returns true() (which btw is what I expect to be right)
let $a := ()
return empty($a)
whereas in 7.8.2 it returns false(). Any advice? Thanks, M.
CG
Christian Grün8 May 2014 13:05 #
What a catch... Will be fixed as soon as possible [1]. Thanks, Christian [1] https://github.com/BaseXdb/basex/issues/950
Quoted text · Marco Lettere · 3 lines
On Thu, May 8, 2014 at 11:42 AM, Marco Lettere <marco.lettere at dedalus.eu> wrote: > let $a := () > return empty($a)
ML
Marco Lettere8 May 2014 13:55 #
Just to augment the issue ...
declare function local:a($i){
   empty($i)
};

declare function local:b($i as node()?){ (: or any other type except
item() :)
   empty($i)
};

declare function local:c($i as item()?){
   empty($i)
};

let $ii := ()
return (local:a(()), empty($ii), local:a($ii), local:b($ii), local:c($ii))
In the basex gui of 7.8.2 the return is "true false false true false". Clueless. M.
Quoted text · Christian Grün · 12 lines
On 05/08/2014 01:05 PM, Christian Grün wrote: > What a catch... Will be fixed as soon as possible [1]. > > Thanks, > Christian > > [1] https://github.com/BaseXdb/basex/issues/950 > > > On Thu, May 8, 2014 at 11:42 AM, Marco Lettere <marco.lettere at dedalus.eu> wrote: >> let $a := () >> return empty($a)
CG
Christian Grün8 May 2014 14:40 #
Quoted text · Marco Lettere · 44 lines
On Thu, May 8, 2014 at 1:55 PM, Marco Lettere <marco.lettere at dedalus.eu> wrote: > Just to augment the issue ... > > declare function local:a($i){ > empty($i) > }; > > declare function local:b($i as node()?){ (: or any other type except item() > :) > empty($i) > }; > > > declare function local:c($i as item()?){ > empty($i) > }; > > let $ii := () > return (local:a(()), empty($ii), local:a($ii), local:b($ii), local:c($ii)) > > In the basex gui of 7.8.2 the return is "true false false true false". > > > Clueless. > M. > > > On 05/08/2014 01:05 PM, Christian Grün wrote: >> >> What a catch... Will be fixed as soon as possible [1]. >> >> Thanks, >> Christian >> >> [1] https://github.com/BaseXdb/basex/issues/950 >> >> >> On Thu, May 8, 2014 at 11:42 AM, Marco Lettere <marco.lettere at dedalus.eu> >> wrote: >>> >>> let $a := () >>> return empty($a) > >

⚡Generated with XQuery