why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
Hi, I was trying to write a small function in vimscript that moves the cursor to a given line, in order to perform some actions. I was trying with something like this function F() cursor(4,0) endfunction but I got and E492 error. However, with call cursor(4,0)

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
2011/7/24 Taylor Hedberg tmhedb...@gmail.com :call is always needed in order to call a function if the function call is not otherwise wrapped in some ex command. In other words, it's never valid to have a bare function call by itself on a line. OK. I need to digest that. I think I should

Re: why is call needed in vimscript?

2011-07-24 Thread Tim Chase
On 07/24/2011 06:03 PM, Jose Caballero wrote: 2011/7/24 Taylor Hedbergtmhedb...@gmail.com :call is always needed in order to call a function if the function call is not otherwise wrapped in some ex command I need to digest that. I think I should start learning once and for all what is exactly

Re: why is call needed in vimscript?

2011-07-24 Thread Tony Mechelynck
On 25/07/11 00:33, Jose Caballero wrote: Hi, I was trying to write a small function in vimscript that moves the cursor to a given line, in order to perform some actions. I was trying with something like this function F() cursor(4,0) endfunction but I got and E492

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
cursor(4,0) is the _value_ of the function. For instance, in a Vim compiled with +float, acos(-1) is the arc-cosine (in radians) of minus one, i.e., the number pi. All functions return a value (if you execute a :return statement without an explicit return value, the function returns the

Re: why is call needed in vimscript?

2011-07-24 Thread Tony Mechelynck
On 25/07/11 02:54, Jose Caballero wrote: [...] I understand it better now. Thanks for the comments. By the way, I think I was searching the wrong thing. :help :call is clear, you are right, but what I tried was :help call and I got a little bit puzzled. My fault. Thanks all of you for your

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
I don't know what you get for :help call :help call call({func}, {arglist} [, {dict}]) *call()* *E699* Call function {func} with the items in |List| {arglist} as arguments. {func} can either be a |Funcref| or the name of a

Re: why is call needed in vimscript?

2011-07-24 Thread Tony Mechelynck
On 25/07/11 03:41, Jose Caballero wrote: I don't know what you get for :help call :help call call({func}, {arglist} [, {dict}]) *call()* *E699* Call function {func} with the items in |List| {arglist} as arguments.

Re: why is call needed in vimscript?

2011-07-24 Thread Tim Chase
On 07/24/2011 09:34 PM, Tony Mechelynck wrote: On 25/07/11 03:41, Jose Caballero wrote: I don't know what you get for :help call Hm, strange. Is this hitting the difference between these two? :help call :help :call -tim -- You received this message from the vim_use maillist. Do

Re: why is call needed in vimscript?

2011-07-24 Thread Jose Caballero
On Jul 24, 2011, at 22:42, Tim Chase v...@tim.thechases.com wrote: On 07/24/2011 09:34 PM, Tony Mechelynck wrote: On 25/07/11 03:41, Jose Caballero wrote: I don't know what you get for :help call Hm, strange. Is this hitting the difference between these two? :help call

Re: why is call needed in vimscript?

2011-07-24 Thread Benjamin R. Haskell
On Sun, 24 Jul 2011, Tim Chase wrote: On 07/24/2011 09:34 PM, Tony Mechelynck wrote: On 25/07/11 03:41, Jose Caballero wrote: I don't know what you get for :help call Hm, strange. Is this hitting the difference between these two? :help call :help :call It sounds like it. But,