Re: A trick to hide all global variables in plugin

2009-02-27 Thread Marc Weber
On Thu, Feb 26, 2009 at 10:38:21PM -0800, Sean wrote: > > Hi, > > All global variables can be found through g: which is a hash table > itself. It might be good to hide those variable from outside and > limit its use only to the plugin itself. > > I found a way to do it: > > "

Re: A trick to hide all global variables in plugin

2009-02-27 Thread Teemu Likonen
On 2009-02-27 06:02 (-0800), Tom wrote: > I suppose you're referring to the standard let form in lisp? Something > like: > > (let ((foo 1)) > (+ foo 2)) > > The point is though that emacs with its dynamic scoping embraces the > possibility that users adapt libraries to their likings and

Re: A trick to hide all global variables in plugin

2009-02-27 Thread Tom
> there is also "let" form to bind local variables. I suppose you're referring to the standard let form in lisp? Something like: (let ((foo 1)) (+ foo 2)) The point is though that emacs with its dynamic scoping embraces the possibility that users adapt libraries to their likings and n

Re: A trick to hide all global variables in plugin

2009-02-27 Thread Teemu Likonen
On 2009-02-27 01:19 (-0800), Tom wrote: > In emacs, all variables are global and users are supposed to tinker > with "plugins" and to amend it in whichever way they want to. In > smalltalk, IIRC everything is globally accessible either and they do > well. Variables may have also buffer-local, wi

Re: A trick to hide all global variables in plugin

2009-02-27 Thread Tom
> All global variables can be found through g: which is a hash table > itself.  It might be good to hide those variable from outside and > limit its use only to the plugin itself. Users wouldn't be able then to change the value of that variable without restarting vim. I personally don't fully un

Re: A trick to hide all global variables in plugin

2009-02-26 Thread Maxim Kim
On 27 фев, 09:38, Sean wrote: > (2) no global variables can be accessed outside the plugin I have multiple files in my plugin, should I "for variable in G" in all of them? BTW, why do you want to hide global vars that you let user to define? I would hide only those globals that user shouldn't acc

A trick to hide all global variables in plugin

2009-02-26 Thread Sean
Hi, All global variables can be found through g: which is a hash table itself. It might be good to hide those variable from outside and limit its use only to the plugin itself. I found a way to do it: " let G = [] call add(G, "g:vimim_datafile")