Unique
Details
- Unique[x] numbers the symbols it creates using $ModuleNumber, and increments $ModuleNumber every time it is called.
- Unique["xxx"] numbers the symbols it creates sequentially, starting at 1 for each string xxx.
- Unique[name,{attr1,attr2,…}] generates a symbol that has the attributes attri.
Examples
open all close allBasic Examples (2)
Scope (4)
Create a unique symbol with no particular name:
Unique[]Create a unique symbol whose name begins with x:
Unique["x"]Create several symbols at once:
Unique[{"x", "y", "z"}]Create a unique symbol in the way Module does:
Unique[x, {Temporary}]Compare with Module:
Module[{x}, {x, Attributes[x]}]Properties & Relations (2)
Each use of Unique[symbol] increments $ModuleNumber:
{$ModuleNumber, Unique[x], $ModuleNumber}Unique[symbol] creates symbols in the same way Module does:
{Module[{x}, x], Unique[x]}See Also
Symbol ToExpression Names GeneratedParameters Module CharacterRange Hash
Function Repository: UniqueContext
Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), Unique, Wolfram Language function, https://reference.wolfram.com/language/ref/Unique.html.
CMS
Wolfram Language. 1988. "Unique." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Unique.html.
APA
Wolfram Language. (1988). Unique. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Unique.html
BibTeX
@misc{reference.wolfram_2026_unique, author="Wolfram Research", title="{Unique}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Unique.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_unique, organization={Wolfram Research}, title={Unique}, year={1988}, url={https://reference.wolfram.com/language/ref/Unique.html}, note=[Accessed: 12-June-2026]}