Unique

Unique[]

generates a new symbol, whose name is of the form $nnn.

Unique[x]

generates a new symbol, with a name of the form x$nnn.

Unique[{x,y,}]

generates a list of new symbols.

Unique["xxx"]

generates a new symbol, with a name of the form xxxnnn.

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 allclose all

Basic Examples  (1)

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (3)

Properties & Relations  (3)

See Also

Symbol  ToExpression  Names  GeneratedParameters  Module  CharacterRange  Hash

Tutorials

Introduced in 1988
(1.0)