Hi,
The help for sort() says the following with respect to the function
reference argument:
...The function is invoked with two
items as argument and must return zero if they are equal, 1 if
the first one sorts after the second one, -1 if the first one
sorts before the second one. Example:
func MyCompare(i1, i2)
return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1
endfunc
Does it really have to return -1, 0, or 1? Or is it OK to just return
negative, 0 or positive? That way it becomes easier:
func MyCompare(i1, i2)
return a:il - a:i2
endfunc
I think the docs should be updated if this is how it behaves. And if
not, the docs and the code should be updated so it does :-)
Rob.
--
Robert Webb <[EMAIL PROTECTED]>,
MineSweeper3D - Take Minesweeper to a whole new dimension!
http://www.software3d.com/Mines3D
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---