Christian wrote: > On Di, 10 Jun 2014, Павлов Николай Александрович wrote: > > > How would you sort a heterogeneous list otherwise? > > Who says, lists are always heterogeneous? I think one could try to sort > numerical, if all list items are of type number or float, else keep the > existing sorting order.
It's just that when the sort() function was added the main purpose was to sort text. From that the idea was added to turn anything into text to be able to sort that too. Obviously we would need to add another sort function, or a special argument to the existing sort function, to have it convert everything to a number and sort that. Text and other non-numbers would be used as zero, just slightly better than reporting an error. We already have the special case for the {func} argument to ignore case when it's one. Could use the same flags as the :sort command has. -- They now pass three KNIGHTS impaled to a tree. With their feet off the ground, with one lance through the lot of them, they are skewered up like a barbecue. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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 vim_use+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.