This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Scoping  /

  • Context[ ] gives the current context.
  • Context[ symbol ] gives the context in which a symbol appears.
  • The current context is the value of $Context.
  • See the Mathematica book: Section 2.6.8.
  • See also: Begin, $ContextPath, Remove.

    Further Examples

    Every symbol (function or variable) in Mathematica is associated with a context. An explanation of how contexts works, and examples of context manipulation, are given in the Further Examples for Begin.
    Without an argument, Context returns the value of the current context (stored in $Context).



    With a symbol as an argument, Context returns the context to which this symbol belongs.