Hi Bram,

Thanks for implementing list[M:N] truncation when N > length(list)!

On 4/16/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
> > function <namespace xml>:Close()
> >   ...
> >
> > What do you think?
>
> Much to complicated.  In nearly all situations you can simply prepend
> an ID to the global name, such as xml_something().  Then it's much
> easier to find (grep) for where the name is used.
>

I tend to agree that the original formulation is too complicated.

What do you think of functions defined as:

function! m:Something()

in a file called $VIMRUNTIME/autoload/path/to/file.vim

being "aliased" to

function! path#to#file#Something()

to make script writing marginally simpler. I am just throwing this idea
out there, not really rooting for it or anything. I can imagine that
implementing something like this would be very similar to the s: or
<SID> mechanism supported right now, except that the functions are
globally visible when prepended with the correct prefix.

Another "really out there" suggestion. A new command like

:alias vim_latex#list# list#

so that from that point on when sourcing the file, replace all list#Foo()
with vim_latex#list#Foo().

If there is something like

:alias vim_latex#list#

(no rhs), then we basically "import" all m:Foo() type functions defined in
autoload/vim_latex/list.vim. In this case ofcourse, there is the
possibility of conflict with globally defined functions of the same
name. Maybe in this case, when actually interpreting a call like Foo(),
first see if Foo itself is defined then see if alias#Foo() is defined
for each "alias" defined for this file.

This will basically completely recover python's import functionality.

Please note that I am in the "fun with ideas" mode here. I am not really
rooting for any of these ideas. I understand that you are probably way
too busy with the vim7 release to be entertaining these wild ideas.

Srinath

Reply via email to