Wednesday, September 21, 2011

Re: Using :let to view a wildcard of variables

In reply to ``Re: Using :let to view a wildcard of variables''
sent 21 September 2011, Wednesday by Spiros Bousbouras

> Wouldn't a list also work ? I tried :let d = [0]
> and then doing :let d[0] = ...
> with all the assignments above worked fine.
I don't like lists for this job. Nothing rational, just code that uses
dictionaries looks better for me. You can use list if you want (though in this
case you'd better write `let l=[0]').

Original text:
> On Sep 18, 9:43 pm, ZyX <zyx.vim@gmail.com> wrote:
> > In reply to ``Re: Using :let to view a wildcard of variables''
> > sent 18 September 2011, Sunday by Spiros Bousbouras
> >
> > > Why are you using a dictionary ? Why not simply write
> > > ...
> >
> > 1. let val=function('tr')
> > 2. let val=0
> >
> > let val=[]
> >
> > 3. function Val()
> >
> > endfunction
> > let Val=function('tr')
> >
> > There is no way to safely handle function references without putting it
> > into a dictionary.
>
> Wouldn't a list also work ? I tried :let d = [0]
> and then doing :let d[0] = ...
> with all the assignments above worked fine.

No comments: