On 2014-06-12 12:51, Bram Moolenaar wrote:
> 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.
I don't care for the idea of a number-specific sort() version any
more than I'd care for a "reverse-sort" specific version. If vim's
internals have enough knowledge to discern between a callable and a
non-callable string, the existing sort() function could take flags in
the place where the function currently is, so you could do
sort(my_array, 'n!')
to sort numerically in reverse order much like ":sort! n" which might
even allow reuse of existing sort code internally.
-tim
--
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thursday, June 12, 2014
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment