On 3 November 2014, mattn <[email protected]> wrote:
> Can you explain this behavior in docs for users?
>
> -------------------------
> function! s:type(x)
> return a:x
> endfunction
>
> let s:type = function('type')
> " => E705
> -------------------------
>
> function! Type(x)
> return a:x
> endfunction
>
> let Type = function('type')
> " => E705
> -------------------------
>
> function! s:type(x)
> return a:x
> endfunction
>
> let s:type = 0
>
> echo s:type('x')
> " => 'x'
> -------------------------
>
> let s:type = function('type')
>
> function! s:type(x)
> return a:x
> endfunction
>
> echo s:type('x')
> " => 1
> -------------------------
>
> let s:type = function('type')
>
> function! s:type(x)
> return a:x
> endfunction
>
> let s:type = function('type')
>
> echo s:type('x')
> " => 1
I can: "Trying to overload internal Vim functions with script-local
functions with the same name is a really bad idea. It probably won't do
what you expect." :)
/lcd
--
--
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.