Thomas wrote:

> The following code throws a "Undefined variable a1:" error:
> 
>       let a1 = 1 | let b = [1,2,3] | echo b[a1:-1]
> 
> When one puts a blank after a1, it's ok though:
> 
>       let a1 = 1 | let b = [1,2,3] | echo b[a1 : -1]
> 
> Since "a1" is no valid scope and "a1:" is an illegal variable name, IMHO
> this code shouldn't be considered ambiguous.

We want to keep the possibility open to add more scopes later.  Thus
anything that looks like {scope}:{name} is handled as such.

Using ":" both for scopes and Sublist is not ideal.  But it's hard to
think of something that is better.  Just always put a space before the
":" used for a Sublist.

-- 
I'm not familiar with this proof, but I'm aware of a significant
following of toddlers who believe that peanut butter is the solution
to all of life's problems...            -- Tim Hammerquist

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