Using ==, strings and numbers can compare as equal, and using index()
on a list, this is not the case:

:echo "2" == 2            " Returns 1
:echo index( [ 2 ], "2")  " Returns -1

The docs just say that index() will "Return the lowest index in |List|
{list} where the item has a value equal to {expr}", leading one to
assume that equality is checked in the same way as ==, but looking at
the source, we're using a function that "Compares the items just like
"==" would compare them, but strings and numbers are different".  So,
is this a behavioral bug, or should the help just make a note that
strings and numbers will not be considered equal?

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui