Thomas wrote:
> > As mentioned in the documentation, automatic conversion only happens
> > between numbers and strings, not with Lists and Dictionaries. This is
> > to avoid mistakes, e.g., trying to concatenate a List and a String.
>
> Something like
>
> let l = [1,2,3]
> exec "Foo ". l
>
> could come handy though -- which isn't possible now.
exec "Foo " . string(l)
Or perhaps:
exec "Foo " . join(l)
You can see you need to tell Vim how to do the conversion. Another
reason why automatic conversion is undesired.
> > Looking back, now that Vim script has become much more complex, a bit
> > more type checking would be good.
>
> A valid point. Mabye this could be done by an assert command/function
> that checks its arguments or does nothing depending on an option (maybe
> 'debug')/flag/variable?
Problem is the syntax of type declarations. Would require function
prototypes, for example. Vim script follows Python here: no type
declarations.
--
Q: Why does /dev/null accept only integers?
A: You can't sink a float.
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///