Re: improvements to fn:sort functions

On Fri, Jan 15, 2021 at 12:01 PM Christian Grün <cg@basex.org> wrote:

> If the input is numeric, the function argument can be used for that:
>
>   sort($data, (), function($key) { -$key })
>

I think, you imply the intent, and I agree.

For correctness sake, I guess you meant,
sort($data, (), function($key) { 0 - $key })


> In others, you can use a subsequent fn:reverse call:
>
>   reverse(sort($data))
>

Wouldn't this be inefficient, as compared to having a native "descending"
argument to the fn:sort function? Yes, but for now, reverse(sort($data))
would work for us.


-- 
Regards,
Mukul Gandhi

Received on Saturday, 16 January 2021 04:21:22 UTC