In article <a96s52$mha$1 / grapevine.wam.umd.edu>,
William Djaja Tjokroaminata  <billtj / y.glue.umd.edu> wrote:
>Therefore, these are the problems:
>1) I cannot define just a single global variable such as $DEBUG
>2) I cannot define the method with no argument
>3) When I define the method with variable number of arguments, I think the
>objects will still be passed in the array even though the method
>actually does nothing.
>4) Doing preprocessing on the code will not work, because the state can
>only be inferred within the code execution, as dictated by the member data
>"@active".

I just skimmed this, so sorry if I've missed the point (or a suggestion
that's already made) but in a recent project we used closures instead of
string parameters:

  def debugMsg
    $stderr.puts(yield) if $debug
  end

  debugMsg { "some message, which may take lots of processing" }

This way, if the debug variable isn't set, the closure never gets executed
because the yield statement never gets called. 

Now, you said you couldn't use a single global variable, but you might be
able to adapt this idea.

Joe