Thinca wrote:

> I thought once again to this problem.
> I often use the idiom as below:
> 
> 
> let s:base = {}
> function! s:base.method()
>   " ...
> endfunction
> 
> let instance = copy(s:base)
> 
> function IsInstance(instance)
>   " Check the instance has a same method as the base
>   return s:base.method == a:instance.method
> endfunction
> 
> 
> This doesn't work when a method is converted to a partial automatically.
> This patch(7.4.1577) breaks backward compatibility.

Hmm, it's a bit of a strange way to check this, but it's valid code.

So, when comparing functions, we need to ignore any arguments or bound
dictionary that a partial adds.

It's not really nice that two partials for the same function but with
different arguments are considered equal.  But it's unavoidable if
comparing the plain function with the partial returns true.
I guess we can compare the string values.

-- 
>From "know your smileys":
 :-)    Funny
 |-)    Funny Oriental
 (-:    Funny Australian

 /// Bram Moolenaar -- [email protected] -- 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_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui