I would think both of these could be implemented as user-defined functions but 
it’s hard to know without seeing a specification: saying you want a function 
called array:index-of() is not very informative unless you explain exactly what 
you want the function to do.

If it’s to behave like fn:index-of() then you can write it as

array:index-of($array, $value) {
   (1 to array:size($array))[ $array(.) = $value ]
}

which is hardly a great hardship to write as a user-defined function.


Michael Kay
Saxonica

> On 26 Jun 2015, at 12:18, W.S. Hager <[email protected]> wrote:
> 
> Hello,
> 
> I've been working with the recent xquery 3.1 implementation in the develop 
> branch eXist-db. I encountered some cases that were quite hard to work around:
> 
> - the lack of array:index-of()
> - the lack of the iterator index in arrayfor-each and related higher-order 
> functions
> 
> Perhaps someone of the workgroup is available to discuss those cases.
> 
> Thanks,
> Wouter
> -- 
> W.S. Hager
> Lagua Web Solutions
> http://lagua.nl <http://lagua.nl/>
> 
> 
> -- 
> W.S. Hager
> Lagua Web Solutions
> http://lagua.nl <http://lagua.nl/>
> 
> _______________________________________________
> [email protected]
> http://x-query.com/mailman/listinfo/talk

_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to