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 error if none exists. Or so. > Don't like the idea. > In Vim script there is no need or possibility to declare variables. > Now, if I forget to init a fun-local variable (happens often to me) > Vim gives me a helpful error ("undefined variable"). And I have the same problem with a: prefixes for my arguments. Fine, keep prefixes for g:, w:, and b:, but a: is just such an incredibly nonstandard way of doing things.
In almost all languages parameters are treated the same as local variables.
"almost all languages" ? totally untrue. This is only true for in C (and descendants). Besides C and descentants, no other language treats function parameters as local variables. I actually like a:,l:,g:,b: etc prefixes. They are useful in practice because in languages like C++, people tend to invent project-specific suffixes and prefixes to distinguish between method vars, local vars, etc. Vim codifies this. I find this convenient. "Incredibly nonstandard" ? Since when ALL programming languages obey one and the same standard ? From forth to lisp to vb.net to perl ? Where did you see common standard for all programing languages ? This thing does not exist. There are families of related languages with common features and spirit, yes, but where did you see "standard features" that programming language must obey ? This is ridiculous statement. There is no such thing. Yakov
