DOCUMENTATION CENTER SEARCH
Mathematica
>
Atomic Elements of Expressions
>
Built-in
Mathematica
Symbol
Everything Is an Expression
Putting Constraints on Patterns
Specifying Types of Expression in Patterns
Tutorials »
|
NumberQ
Head
LeafCount
Length
See Also »
|
Atomic Elements of Expressions
Testing Expressions
More About »
AtomQ
AtomQ
[
expr
]
yields
True
if
expr
is an expression which cannot be divided into subexpressions, and yields
False
otherwise.
MORE INFORMATION
You can use
AtomQ
in a recursive procedure to tell when you have reached the bottom of the tree corresponding to an expression.
AtomQ
gives
True
for symbols, numbers, strings and other raw objects, such as sparse arrays.
AtomQ
gives
True
for any object whose subparts cannot be accessed using functions like
Map
.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Test if an expression cannot be subdivided:
In[1]:=
Out[1]=
In[2]:=
Out[2]=
Since it is not an atom, its parts can be extracted:
In[3]:=
Out[3]=
This is a number that is an atom:
In[4]:=
Out[4]=
Scope
(6)
Applications
(2)
Properties & Relations
(1)
SEE ALSO
NumberQ
Head
LeafCount
Length
TUTORIALS
Everything Is an Expression
Putting Constraints on Patterns
Specifying Types of Expression in Patterns
MORE ABOUT
Atomic Elements of Expressions
Testing Expressions
New in 1 | Last modified in 5
© 2008 Wolfram Research, Inc.