On Sun, Jul 26, 2009 at 10:54 AM, Jacky Liu wrote:
>
>
> Hi everyone! I have some questions about argument types of self-
> defined functions, please help me:
...
> The output of these functions looks almost ok, but occasionally (4 out
> of hundreds of thousands of lines) Vim complains about the wrong
> augument type (error E706).
Not really possible to be sure given that you haven't shown us any
real code, but my wild guess would be that you're iterating over
something using a for loop, and the loop variable has the wrong type
to hold one of the arguments. For example:
for item in values({ 'x' : [ 1, 2, 3 ], 'y' : 1 }) | echo item | endfor
leads to
[1, 2, 3]
E706: Variable type mismatch for: item
because 'item' is a List after the first iteration, but needs to hold
a Number on the second iteration. You can get around this by calling
':unlet item' before the :endfor
~Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---