# Namespaces in Mathematica

In many programming languages one can define a namespace

with namespace abc


How can the similar be done in Mathematica? The Module and Block commands, can somewhat mimick this, but it is only in the command, it doesn't act as a definition.

How can this be done in Mathematica?

-
Have a look at Context. –  b.gatessucks Sep 24 '13 at 7:38
Ah, so with context I can do amass=2, bmass=3. Is there any way to define a block, where everything inside inherits that context? –  Oskar Sep 24 '13 at 7:53
@Oskar It sounds like you want to create packages. Please see: (29324). Be aware that you cannot use Begin and End in a Module without great care; see: (8295) –  Mr.Wizard Sep 24 '13 at 7:59
Here are two links to documentation pages relevant to your question. Namespace Management and Package Development. –  m_goldberg Sep 24 '13 at 9:48
Perhaps this will help clarify things for you. In Mathematica, namespaces are the called contexts and packages provide the means for defining persistent namespaces. –  m_goldberg Sep 24 '13 at 9:58

In Mathematica, $ContextPath contains a list of the contexts where the definition of a symbol is sought (when that symbol has no namespace qualifications). You can use $ContextPath = Prepend[\$ContextPath, "abc"]
`