You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Max Bowsher <ma...@ukf.net> on 2003/11/07 11:11:24 UTC

cvs2svn and global variables

I've just been looking at Kim Lester's debug-messages patch, and I thought
it would be neater if, rather than:

------------------
if debug:
  print "foo"
------------------

to have:

------------------
debug = 0

def dbg(msg):
  if debug:
    print msg

...

dbg "foo"
------------------

This does involve adding another global variable, though, and given that
almost all other global state is wrapped into a context (ctx) object that is
passed around, I thought it better to ask first.

Opinions?

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: cvs2svn and global variables

Posted by Greg Stein <gs...@lyra.org>.
On Fri, Nov 07, 2003 at 11:11:24AM -0000, Max Bowsher wrote:
>...
> This does involve adding another global variable, though, and given that
> almost all other global state is wrapped into a context (ctx) object that is
> passed around, I thought it better to ask first.

For something like a debug value, rather than config/option state, that
should be just fine (IMO)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: cvs2svn and global variables

Posted by kf...@collab.net.
"Max Bowsher" <ma...@ukf.net> writes:
> This does involve adding another global variable, though, and given that
> almost all other global state is wrapped into a context (ctx) object that is
> passed around, I thought it better to ask first.
> 
> Opinions?

+1.  It's a standard idiom, people will recognize why it's a global.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org