On Jun 4, 2013 12:54 AM, "Marc Weber" <marco-owe...@gmx.de> wrote:
>
> I still vote for the module solution, because you can import it into
global
> namespace for debugging and testing.
>
> While writing plugins being able to
>
>   :py import my-module
>   :py my-module.do_thing(foo)
>
> is important to me.
>
>   Using execfile('file',{},{})
>
> access to the namespace is lost which would force me to move almost all
> code into a module. So why not use a module in the first place?

Is not it what I am talking when writing about loadpyplugin()? Modules are
not expected to be sourced automatically. Also nothing can prevent you to
record reference to globals somewhere.

The discussion has now gone into the direction when I will be against
automatic sourcing of anything related to python. Your proposal does not
error out without python (or it will be too intrusive in case sourcing
python files is optional in some particular plugin), must not contain
anything to be shared (because modules are not expected to be sourced
without request and non-modules are not expected to contain anything to
share) and putting anything meaningful there is against loadpyplugin()
function meaning that it reduces to two lines: import and calling setup
function.

> About "being vergin". Could we just proivde a clean() function which
> cleans a module namespace?
>
>   for x in globals():
>     delete x
>
> People who want could use that then.

I still do not see a single reason to keep globals.

>
> When wirting plugins I never bothered about cleaning any environment.
> There are very rare cases when I have to - and then I restart Vim.
>
> Marc Weber
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
"vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to vim_dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to