Function Resource

SymbolQ

Checks if an expression is a symbol, or not

ResourceFunction["SymbolQ"][expr]

gives True if expr is a symbol, and False otherwise.

Examples

Basic Examples

Check if the expression is a symbol, or not:

In[1]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
SymbolQ"][x]
Out[1]=
In[2]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
SymbolQ"][42]
Out[2]=
In[3]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
SymbolQ"][f[x]]
Out[3]=

SymbolQ does not evaluate its arguments:

In[4]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
SymbolQ"][$CloudBase]
Out[4]=
In[5]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
SymbolQ"][a + a - a]
Out[5]=
In[6]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
SymbolQ"][a]
Out[6]=

Scope

SymbolQ can be used with Select:

In[7]:=
Select[{1, 4.2, f[x], x}, ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
SymbolQ"]]
Out[7]=