Initialize[sym]
initializes the symbol sym from persistent values on the default persistence path.
Initialize[sym,{loc1,…}]
initializes the symbol sym from persistent values on the persistence path {loc1,…}.
Initialize["patt"]
initializes all variables matching the string pattern "patt".
Initialize
Initialize[sym]
initializes the symbol sym from persistent values on the default persistence path.
Initialize[sym,{loc1,…}]
initializes the symbol sym from persistent values on the persistence path {loc1,…}.
Initialize["patt"]
initializes all variables matching the string pattern "patt".
Details and Options
- The following option can be given:
-
MergingFunction Automatic the function applied to the list of values found - Initialize[All] is equivalent to Initialize["*"].
- Initialize[spec] is equivalent to Initialize[spec,$PersistencePath].
- A persistence location is given as PersistenceLocation["type"] or "type".
Examples
open all close allBasic Examples (1)
Scope (1)
Set initializations for two variables in a given context:
InitializationValue[ctx`a, "KernelSession"] = 42;
InitializationValue[ctx`b, "KernelSession"] = 43;Initialize all variables in the given context:
Initialize["ctx`*"]{ctx`a, ctx`b}Options (1)
MergingFunction (1)
Establish a default value and merging function for an initialization value:
InitializationValue[ivar, "Local", MergingFunction -> Flatten] = {};Add an initialization value at the front end persistence location:
InitializationValue[ivar, "FrontEndSession"] = ival1;The resulting initialization value now uses the default merging function:
InitializationValue[ivar]You can override the default merging function to use for an initialization:
Initialize[ivar, MergingFunction -> First];
ivarProperties & Relations (1)
Set an initialization value for a variable persisting for the current front end session:
InitializationValue[Global`myvar, "FrontEndSession"] = 43Quit[];Each newly started kernel will automatically invoke Initialize for all variables:
Global`myvarAfter quitting and restarting the front end, the initialization value is gone:
Global`myvarRelated Guides
Related Workflows
- Add the Cloud to the Persistence Search Path
History
Text
Wolfram Research (2017), Initialize, Wolfram Language function, https://reference.wolfram.com/language/ref/Initialize.html.
CMS
Wolfram Language. 2017. "Initialize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Initialize.html.
APA
Wolfram Language. (2017). Initialize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Initialize.html
BibTeX
@misc{reference.wolfram_2026_initialize, author="Wolfram Research", title="{Initialize}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/Initialize.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_initialize, organization={Wolfram Research}, title={Initialize}, year={2017}, url={https://reference.wolfram.com/language/ref/Initialize.html}, note=[Accessed: 12-June-2026]}