MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: TraceInternal and OptionQ

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8994] Re: [mg8949] TraceInternal and OptionQ
  • From: Olivier Gerard <jacquesg at pratique.fr>
  • Date: Tue, 7 Oct 1997 03:35:40 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

At 07:59 +0200 97.10.06, Tom Burton wrote:
> Olivier Gerard recently mentioned the option "TraceInternal" to the
> function "Trace". Wow! This is the first I've heard (seen) of this
> option. So far, I cannot find it in the MMA2 or MMA3 books or in MMA3
> on-line docs. Yet it seems very useful--perhaps essential, on occasion.
> Is this an "undocumented" feature? Are users supposed to avoid it? If
> so, what alternative is there?
>
Dear Tom,

I have taken the habit to learn Mathematica by using the ??
instruction. You can find a few interesting things with it.
Being specific, Trace already generate a lot of output and
TraceInternal->True can be even more overwhelming so I don't
recommend it in general but in examining very tiny areas of your
code where you suspect an interaction with Mathematica internal
procedures. As for the official position, ask WRI (or maybe
David "Fast RE:" Withoff will do it already). As this is a
debugging tool, it would be stupid not to use it when needed.
It can cause addiction, not compatibility problems as you are
not likely to put a Trace into your code.

> Similarly, after reading about the function OptionQ in a third-party
> book, I began using it extensively to screen for options in argument
> lists, as in
>
> myFunc[matrix_?MatrixQ, label_String, opts___?OptionQ] :=3D body
>
> Recently, I noticed that the function "OptionQ" is similarly
> undocumented. In this case, I note that the pattern "opts___Rule" seems
> to perform the same function, perhaps a bit more elegantly, so I have
> began using "opts___Rule" in place of "opts___?OptionQ". Can anyone see
> a disadvantage to this substitution?


For myself, I have seen a little difference in timing, the
advantage being to ___Rule. This is certainly because the ?OptionQ
involves a function call.


Olivier





  • Prev by Date: Re: Parsing polygon lists
  • Next by Date: Re: Re: AxesLabels on the MacOS, mkdk
  • Previous by thread: TraceInternal and OptionQ
  • Next by thread: Re: TraceInternal and OptionQ