Bug in array:fold-left?
Sunday, 21 December 2014 · 3 messages
MG
Marc van Grootel21 Dec 2014 12:05 #
Hi,
I think I've spotted a bug in
array:fold-left (using 20141219 snapshot)array:tail([1,2,3]) => [2,3]
array:fold-left(
array:tail([1,2,3]),
(),
function($result, $fn) {
($result, $fn)
}
)=> (1,2)
Using
array:fold-right in the above example returns (2,3).--
--Marc
CG
Christian Grün21 Dec 2014 16:48 #
Hi Marc,
Leo has just fixed my bug in the array iterator code. Thanks! A new snapshot is available.
Christian
Quoted text · Marc van Grootel · 22 lines
On Sun, Dec 21, 2014 at 12:05 PM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > Hi, > > I think I've spotted a bug in array:fold-left (using 20141219 snapshot) > > array:tail([1,2,3]) => [2,3] > > array:fold-left( > array:tail([1,2,3]), > (), > function($result, $fn) { > ($result, $fn) > } > ) > > => (1,2) > > Using array:fold-right in the above example returns (2,3). > > -- > --Marc
MG
Marc van Grootel21 Dec 2014 18:15 #
Verified, fixed.
Thanks
--Marc
Quoted text · Christian Grün · 32 lines
On Sun, Dec 21, 2014 at 4:48 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Marc, > > Leo has just fixed my bug in the array iterator code. Thanks! A new > snapshot is available. > > Christian > > > On Sun, Dec 21, 2014 at 12:05 PM, Marc van Grootel > <marc.van.grootel at gmail.com> wrote: >> Hi, >> >> I think I've spotted a bug in array:fold-left (using 20141219 snapshot) >> >> array:tail([1,2,3]) => [2,3] >> >> array:fold-left( >> array:tail([1,2,3]), >> (), >> function($result, $fn) { >> ($result, $fn) >> } >> ) >> >> => (1,2) >> >> Using array:fold-right in the above example returns (2,3). >> >> -- >> --Marc
--
--Marc
Written for BaseX 7.9. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery