RE: wish: allow a: in the function def

2007-04-25 Thread Halim, Salman
Sorry; it's located here: http://vim.sourceforge.net/scripts/script.php?script_id=353 > -Original Message- > From: Halim, Salman > Sent: Wednesday, April 25, 2007 10:28 AM > To: 'Marc Weber'; vim-dev@vim.org > Subject: RE: wish: allow a: in the function def

RE: wish: allow a: in the function def

2007-04-25 Thread Halim, Salman
[EMAIL PROTECTED] > Sent: Wednesday, April 25, 2007 10:24 AM > To: vim-dev@vim.org > Subject: Re: wish: allow a: in the function def > > > So maybe one could make vimscript search a variable foo as l:foo, > > a:foo, (maybe also: w:foo, b:foo), s:foo, g:foo, and then throw a

Re: wish: allow a: in the function def

2007-04-25 Thread Marc Weber
> So maybe one could make vimscript search a variable foo as l:foo, a:foo, > (maybe also: w:foo, b:foo), s:foo, g:foo, and then throw an undefined > variable name error if none exists. Or so. No. I don't want to go back to VB without using Option Explicit ;) Don't let vim find some value somewhe

Re: wish: allow a: in the function def

2007-04-25 Thread Marc Weber
> So that the name is consistent everywhere. Makes it much easier to search. I > would appreciate this addition, too. Example function! Test(param) echo a:param endfunction When you see param and want to know where it is used, all you have to do is pressing * (using set hlsearch or a plugin s

Re: wish: allow a: in the function def

2007-04-25 Thread Taylor Venable
On Mon, 23 Apr 2007 21:10:20 -0500 Robert Lee <[EMAIL PROTECTED]> wrote: > Nikolai Weibull wrote: > > On 4/23/07, Yakov Lerner <[EMAIL PROTECTED]> wrote: > >> wish: allow a: in the function definition line: > >> function foo(a:line1, a:line2) > >> This is currently not allowed. But it seems

Re: wish: allow a: in the function def

2007-04-25 Thread Nikolai Weibull
On 4/25/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: Nikolai Weibull wrote: > Yes, that's the reason for the a: modifier. And yes, why are they > read-only?VimScript isn't a functionaly programming language. > Variables are mutable; arguments should be to. Why? Vim is a good programm

Re: wish: allow a: in the function def

2007-04-24 Thread Spencer Collyer
On Wed, 25 Apr 2007 03:02:39 +0200, Nikolai Weibull wrote: > On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: > > As long as function arguments are read-only, it is good to have > > the a: modifier. > > > > In fact, why are they read-only, although call is by value? > > Yes, that's the reason fo

Re: wish: allow a: in the function def

2007-04-24 Thread Spencer Collyer
On Mon, 23 Apr 2007 21:10:20 -0500, Robert Lee wrote: > Counterwish #2: Dump VimScript and replace it with EMCAScript (maybe > using SpiderMonkey) so that people don't need to learn a new language > just to change the color scheme or keyboard mappings. Yes, this will > break backwards compatibil

Re: wish: allow a: in the function def

2007-04-24 Thread A.J.Mechelynck
Nikolai Weibull wrote: On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: Nikolai Weibull schrieb: > On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: >> Thomas schrieb: > >> > So maybe one could make vimscript search a variable foo as l:foo, >> a:foo, >> > (maybe also: w:foo, b:foo), s:foo, g:

Re: wish: allow a: in the function def

2007-04-24 Thread Nikolai Weibull
On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: Nikolai Weibull schrieb: > On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: >> Thomas schrieb: > >> > So maybe one could make vimscript search a variable foo as l:foo, >> a:foo, >> > (maybe also: w:foo, b:foo), s:foo, g:foo, and then throw an u

Re: wish: allow a: in the function def

2007-04-24 Thread Nikolai Weibull
On 4/24/07, Yakov Lerner <[EMAIL PROTECTED]> wrote: Besides C and descentants, no other language treats function parameters as local variables. What am I missing? * You can assign to parameters in most languages. * You don't prefix parameters in some manner in most languages. * A parameter

Re: wish: allow a: in the function def

2007-04-24 Thread Andy Wokula
Nikolai Weibull schrieb: On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: Thomas schrieb: > So maybe one could make vimscript search a variable foo as l:foo, a:foo, > (maybe also: w:foo, b:foo), s:foo, g:foo, and then throw an undefined > variable name error if none exists. Or so. Don't

Re: wish: allow a: in the function def

2007-04-24 Thread A.J.Mechelynck
Robert Lee wrote: [...] Counterwish #2: Dump VimScript and replace it with EMCAScript (maybe using SpiderMonkey) so that people don't need to learn a new language just to change the color scheme or keyboard mappings. Yes, this will break backwards compatibility. Tough. [...] Don't? WTF EMCASc

Re: wish: allow a: in the function def

2007-04-24 Thread Yakov Lerner
On 4/24/07, Nikolai Weibull <[EMAIL PROTECTED]> wrote: On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: > Thomas schrieb: > > So maybe one could make vimscript search a variable foo as l:foo, a:foo, > > (maybe also: w:foo, b:foo), s:foo, g:foo, and then throw an undefined > > variable name err

Re: wish: allow a: in the function def

2007-04-24 Thread Nikolai Weibull
On 4/24/07, Andy Wokula <[EMAIL PROTECTED]> wrote: Thomas schrieb: > So maybe one could make vimscript search a variable foo as l:foo, a:foo, > (maybe also: w:foo, b:foo), s:foo, g:foo, and then throw an undefined > variable name error if none exists. Or so. Don't like the idea. In Vim scri

Re: wish: allow a: in the function def

2007-04-24 Thread Thomas
Also would it be _recommended_ to ever use a window-local variable without the "w:" prefix? ... IMHO not. Well, it would make it easier for the user to configure scripts. I'm myself not convinced that it's a good idea to allow this for all variables, though. But I think it could be useful in

Re: wish: allow a: in the function def

2007-04-24 Thread Andy Wokula
Thomas schrieb: Yakov Lerner schrieb: wish: allow a: in the function definition line: function foo(a:line1, a:line2) yeah, occasionally I do :setl isk+=: to get completion of variable names in vim scripts. I'd like to have this for function arguments, too. Counterwish: implement be

Re: wish: allow a: in the function def

2007-04-24 Thread Thomas
wish: allow a: in the function definition line: function foo(a:line1, a:line2) Counterwish: implement better semantics for VimScript so that the lookup order of variables alleviates the need for explicit environments. Yes, this will break backwards compatibility. I personally like both

Re: wish: allow a: in the function def

2007-04-23 Thread Peter Hodge
--- Nikolai Weibull <[EMAIL PROTECTED]> wrote: > On 4/23/07, Yakov Lerner <[EMAIL PROTECTED]> wrote: > > wish: allow a: in the function definition line: > > function foo(a:line1, a:line2) > > This is currently not allowed. But it seems logical to allow it. > > Why should it be? Extra typi

Re: wish: allow a: in the function def

2007-04-23 Thread Robert Lee
Nikolai Weibull wrote: On 4/23/07, Yakov Lerner <[EMAIL PROTECTED]> wrote: wish: allow a: in the function definition line: function foo(a:line1, a:line2) This is currently not allowed. But it seems logical to allow it. Why should it be? Extra typing? Counterwish: implement better seman

Re: wish: allow a: in the function def

2007-04-23 Thread Nikolai Weibull
On 4/23/07, Yakov Lerner <[EMAIL PROTECTED]> wrote: wish: allow a: in the function definition line: function foo(a:line1, a:line2) This is currently not allowed. But it seems logical to allow it. Why should it be? Extra typing? Counterwish: implement better semantics for VimScript so th