> > By the way, why "luaeval('{}')" returns "0" instead of throwing an error?
> 
> Two reasons: luaeval depends on a conversion routine and I don't want to throw
> an error whenever a Lua value cannot be converted to a Vim type; and I usually
> avoid throwing errors if they can be thrown by the user based on a returned
> value, as it is the case here.
    :echo luaeval('{}') is luaeval('false')
    1
. Without +float it is worse. Depending on the plugin it may be an issue, and 
it definitely prevents anybody from writing a wrapper for luaeval that will 
throw an error in case of failed conversion.

I also don’t like the idea of such implicit conversion that gives not a single 
clue about the source of invalid value (if it were stringified like mzeval() 
claims to do it would be easier to guess where invalid input is received. 
Explicit error like in my py*eval() is better because you immediately see error 
line number) and with vim ability to convert numbers to strings or floats shown 
error may be actually far away from the real one, if there will be any (and not 
silent unexpected behavior).

-- 
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

Raspunde prin e-mail lui