This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Symbol

Symbol
refers to a symbol with the specified name.
  • All symbols, whether explicitly entered using Symbol or not, have head Symbol.
  • can be used as a pattern to represent any symbol.
  • The string in Symbol must be an appropriate name for a symbol. It can contain any letters, letter-like forms, or digits, but cannot start with a digit.
  • Symbol creates a new symbol if none exists with the specified name.
  • A symbol such as has a name .
  • If Symbol creates a new symbol, it does so in the context specified by $Context.
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Use Symbol to create new symbols in a program:
Use Symbol for pattern matching:
Create a symbol in a given context:
Create a symbol in the current context:
Create several symbols in a program:
Symbol creates new symbols in the current context:
Unique creates symbols with a unique new name:
Module creates new temporary symbols every time it is evaluated:
Symbol and SymbolName are inverses of each other:
Many functions of symbols also accept symbol names as arguments:
Context gives the context of a symbol:
Possible symbol names can be characterized by regular expressions:
The name must satisfy the syntax for symbol names:
New in 1 | Last modified in 3