Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1992
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1992

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

Search the Archive

Previous Mail concerning Suppressing Context Printing

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Previous Mail concerning Suppressing Context Printing
  • From: Scott Herod <sherod at picard.colorado.edu>
  • Date: Thu, 19 Nov 92 16:52:39 -0700

I sent a note a little while ago about trying to get a package to print
variables.  The real question should have been, "How can I suppress the
printing of the context of a variable?"  Bruce Fast sent the following
suggestion which works.

Trick the printing routine into seeing the `Private` context.

___________________________________________________________

BeginPackage["MyPackage`"]

tnirP::usage = "Look at it yourself!"

f::usage = "This is the variable."

Begin["`Private`"]

    f = myname;

    tnirP[anything_] :=  Module[{},
        $ContextPath = Prepend[$ContextPath, "MyPackage`Private`"];
        Print[f];
        $ContextPath = Delete[$ContextPath, 1];
        Null]



End[]

EndPackage[]
_________________________________________________________

Scott Herod




  • Prev by Date: LIst of BUGS ?
  • Next by Date: ListPlot3D
  • Previous by thread: LIst of BUGS ?
  • Next by thread: ListPlot3D