Loading ...
Sorry, an error occurred while loading the content.

Re: "ocaml_beginners"::[] "cleaner" ifdefs with camlp4

Expand Messages
  • james woodyatt
    ... The approach I take to this is to put my log message generation inside [assert] expressions and use a method of sending log messages that always returns
    Message 1 of 16 , Jun 30, 2004
    • 0 Attachment
      On 30 Jun 2004, at 17:06, Henri DF wrote:
      >
      > I have a bunch of logging calls which i would like to be able to
      > remove from my code for performance purposes. These calls are
      > typically in
      > the form of a method call (using an inherited log class).
      >
      > Using camlp4 with pa_macro would be one option, but i really don't
      > want to
      > litter my code with ifdefs.
      >
      > Is it possible to do this type of thing with camlp4, and if so would
      > anyone have pointers to examples of how to do this?

      The approach I take to this is to put my log message generation inside
      [assert] expressions and use a method of sending log messages that
      always returns [true] as a result. When the -noassert flag is used,
      all this code is removed.


      --
      j h woodyatt <jhw@...>
      don't take any wooden root certs...
    Your message has been successfully submitted and would be delivered to recipients shortly.