Something like

  let l = [1,2,3]
  exec "Foo ". l

could come in handy though -- which isn't possible now.

Although I just realized that lists seem to be passed on by reference and this would create a new copy if the string presentation of a list were a parseable list.

Which leads to another point: How do I pass a list by reference to Foo, what most likely should be done in this example? Maybe I should read the manual once again.

I noticed that v:val in map() type of functions does this properly, eg

  fun! Foo(l, a)
      call add(a:l, a:a)
  endf

  let l = []
  call map([1,2,3], 'Foo(l, v:val)')

works properly. But I'm digressing.

Regards.

Reply via email to