Justin Constantino wrote:

> Currently, if you try to assign a value to a variable with a different
> type, you get:
> 
> E706: Variable type mismatch
> 
> To make it work, you have to first unlet the variable, which is kind
> of annoying if the expression you are assigning references that
> variable.  For example, to split a string in-place, you have to do:
> 
> let foo = "one,two,three"
> let temp = split(foo, ',')
> unlet foo
> let foo = temp
> unlet temp
> 
> As a minor improvement, I think it would be nice if you could do:
> 
> let foo = "one,two,three"
> let! foo = split(foo, ',')

Suppose someone asks you what the "foo" variable is for, what are you
going answer?

The point is: let the variable name reflect what it contains, don't
re-use the same variable for something else.  That way your code will be
a lot more readable.

 let fooline  = "one,two,three"
 let foowords = split(fooline, ',')

-- 
For large projects, Team Leaders use sophisticated project management software
to keep track of who's doing what.  The software collects the lies and guesses
of the project team and organizes them in to instantly outdated charts that
are too boring to look at closely.  This is called "planning".
                                (Scott Adams - The Dilbert principle)

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

Reply via email to