Begin
✖
Begin
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Define a function f in the MyContext` Context:

https://wolfram.com/xid/0giv4y-j5jw7v


https://wolfram.com/xid/0giv4y-j8alxw

https://wolfram.com/xid/0giv4y-s71x2

f will generally be hidden in the restored context:

https://wolfram.com/xid/0giv4y-l3yd9x

The definitions are all in MyContext`f :

https://wolfram.com/xid/0giv4y-clpsxx
The function can be called using its fully qualified name:

https://wolfram.com/xid/0giv4y-et9jyh

Applications (1)Sample problems that can be solved with this function
Make symbols used for package function definitions private, reducing the possibility for conflict:

https://wolfram.com/xid/0giv4y-haa4ep

Any use of the symbol f in the package context ensures that f is created in that context:

https://wolfram.com/xid/0giv4y-dtxgtq
When the context given to Begin starts with ` it extends from the current context:

https://wolfram.com/xid/0giv4y-mdu8qx


https://wolfram.com/xid/0giv4y-bubg65

https://wolfram.com/xid/0giv4y-por66k


https://wolfram.com/xid/0giv4y-mgttio
Since the symbol f is in the package context, the function works after EndPackage:

https://wolfram.com/xid/0giv4y-ga3wqo

You can see that the other variable uses the private context:

https://wolfram.com/xid/0giv4y-ia4f0s
Properties & Relations (3)Properties of the function, and connections to other functions
Begin["cont`"] sets $Context to "cont`":

https://wolfram.com/xid/0giv4y-7m7isf


End restores $Context to its value before the matching Begin:

https://wolfram.com/xid/0giv4y-foci5r

Unlike BeginPackage, Begin does not modify $ContextPath:

https://wolfram.com/xid/0giv4y-f64hii

Similarly, End does not modify it, either:

https://wolfram.com/xid/0giv4y-54u8m

Begin does not alter the value of $ContextAliases:

https://wolfram.com/xid/0giv4y-097mdd

End restores $ContextAliases to its value before the matching Begin:

https://wolfram.com/xid/0giv4y-8614wm

Wolfram Research (1988), Begin, Wolfram Language function, https://reference.wolfram.com/language/ref/Begin.html.
Text
Wolfram Research (1988), Begin, Wolfram Language function, https://reference.wolfram.com/language/ref/Begin.html.
Wolfram Research (1988), Begin, Wolfram Language function, https://reference.wolfram.com/language/ref/Begin.html.
CMS
Wolfram Language. 1988. "Begin." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Begin.html.
Wolfram Language. 1988. "Begin." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Begin.html.
APA
Wolfram Language. (1988). Begin. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Begin.html
Wolfram Language. (1988). Begin. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Begin.html
BibTeX
@misc{reference.wolfram_2025_begin, author="Wolfram Research", title="{Begin}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Begin.html}", note=[Accessed: 20-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_begin, organization={Wolfram Research}, title={Begin}, year={1988}, url={https://reference.wolfram.com/language/ref/Begin.html}, note=[Accessed: 20-May-2025
]}