4

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?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Oskar
  • 41
  • 1

1 Answers1

3

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`"]

to achieve what you asked.

Hector
  • 6,428
  • 15
  • 34