On 9/17/07, Tony Mechelynck <[EMAIL PROTECTED]> wrote:

> Nikolai Weibull wrote:

> > Ranting aside, the prefix of number above is now#.  I mean, have I
> > gone to the trouble to declare what "namespace" the variable is in,
> > shouldn't that be enough?  And
> >
> >   let s:bug#number = 1
> >
> > results in a
> >
> > E461: Illegal variable name: s:bug#number
> >
> > anyway, so there's no conflict in what you mean when you say bug#number.

> s:number is not visible outside the script. It can never cause a sourcing of
> the script.
>
> g:bug#number (or bug#number outside a function) is defined in the script but
> visible everywhere. If you use it outside the script and it is undefined, does
> the script get loaded? Or is # just a lambda 'iskeyword' character when it
> applies to a variable?

No, it doesn't cause the script to get loaded.  This to allow you to
set "options" for an autoloaded script before it gets loaded.

What is "lambda" supposed to mean here?

> l:number ( or number, used inside a function) is not visible outside that
> function. What about l:bug#number? I suppose it should be handled like
> s:bug#number (both valid or both throwing an error).

There are no such variable scopes.  That's exactly what I said in the
message you responded to.

> There are other scopes: w:value, s:value and t:value are visible outside the
> script, but not everywhere. I suppose w:bug#number, b:bug#number and
> t:bug#number should also be valid.

Why?  None of the variables you talk about make much sense in having
available.  The only really useful scope for a autloaded script's
variable, that is, a variable of the form script#variable, is global
(g:).

> - name (with omitted scope) defaults to l:name if in a function, otherwise to
>   g:name

Yes, script#name can never be local to a function.  My suggestion is
that script#name is clear enough in that it is a global variable.

  nikolai

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui