Le mardi 10 juin 2014 à 07:15, Ben Klein a écrit:
>    let numbers = [7, 9, 18, 12, 22]
>    echo sort(numbers)
> 
>    [12, 18, 22, 7, 9]
> 
>    What's going on here? Is there some way by which I can sort these as
>    Numbers and not Strings?


If you use “sort(numbers, 'MyCompare')” with “MyCompare()” define as
in the help for “sort()”, it works well.

On the other hand, I’d say sorting numbers as strings is definitely a
bug in this situation.

Best,
Paul

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
  • Sorting a List of N... Ben Klein
    • Re: Sorting a ... Paul Isambert
      • Re: Sortin... Benjamin Klein
        • Re: So... Paul Isambert
          • Re... Павлов Николай Александрович
            • ... Christian Brabandt
              • ... Павлов Николай Александрович
              • ... Bram Moolenaar
                • ... Tim Chase
                • ... Christian Brabandt
                • ... Bram Moolenaar

Reply via email to