MathGroup Archive 1992

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

Search the Archive

Previous Mail concerning Suppressing Context Printing


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