Christian Brabandt schrieb:
> On Tue, November 10, 2009 12:19 pm, Andy Wokula wrote:
>> Sorry, I didn't understand (dunno Perl).
>> I think you can't do it so nicely in Vim, but you can try the
>> following:
>>
>> " helper to keep the list unchanged (not required):
>> func! KeepVal(_)
>> return v:val
>> endfunc
>>
>> let in_list = ["foo", "bar"]
>> let out_dict = {}
>> call map(in_list, 'KeepVal(extend(out_dict, {v:val : 1}))')
>
> You don't need KeepVal():
> :call map(copy(in_list), 'extend(out_dict, {v:val : 1})')
I just didn't like getting a list full of dict references. And the
return value of map() will be less "junky".
--
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---