Hi,
I have attempted to implement libjn:accumulate[1]. This implementation is
based on the part of the specification[2] which states that the function be
implemented as follows:
declare function libjn:accumulate($sequence as item()*) as object()
{
{|
for $key in $sequence() return { $key : $sequence($key) }
|}
};
Since this method uses the dynamic constructor for objects this will throw
an error upon pair collision.
But the specification also says :
"This function dynamically builds an object, like jn:object, except that it
does not throw an error upon pair collision. Instead, it accumulates them
into an array."
I am not sure I understand this because this conflicts with the previous
(declare function) method specified and my implementation is based on the
declare function method. What is the use of accumulating them into an
array? Further no examples are provided on this.
[1] https://github.com/apache/vxquery/pull/126
[2]
http://jsoniq.org/docs/JSONiqExtensionToXQuery/html-single/index.html#idm139680684849856
Thank you.
Yours sincerely,
Riyafa
--
Riyafa Abdul Hameed
Undergraduate, University of Moratuwa
Email: [email protected]
Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/>
<http://facebook.com/riyafa.ahf> <http://lk.linkedin.com/in/riyafa>
<http://twitter.com/Riyafa1>