Re: patch: ':let a="+10"' etc
- Neil Bird wrote:
> IIUC, what we have is the situation where every variable/literal isSo long as you pass only "20" or "-20" it will work. I don't see where a
> basically a string. Then, in some circumstances if you're lucky, the
> strings may be interpreted as numbers. Is that fair?
"+20" would come from, unless you typed it somewhere. In that case you just
shouldn't have typed it.
> So, would it be more helpful if there was a (say) 'eval()' function thatThis did come up in another discussion too. The conclusion there was that "it
> did it's utmost to interpret and evaluate a string as a number (e.g.,
> "eval( '1+(--3)++2' )" sort of thing)?
would be nice if" we had some expression evaluation of a string, and the
result then again used in an expression. Works like backticks in a shell
command. The problem is that it's not so easy to implement. And since using
":exe" will do it too, in a more verbose way, it's not really needed.
I'm trying to steer away from changes that "would be nice" or "make the Vim
script look better". Otherwise Vim 6.0 will never be finished!
> In the same vein, anything not numeric would be interpreted as '0' (?)Instead of causing an error message, yes.
From "know your smileys":
[:-) Frankenstein's monster
/// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
\\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///