Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Check if expressions have certain heads
ResourceFunction["HeadQ"][heads] is an operator form of ResourceFunction["HeadQ"]. |
Test if an expression has a certain head:
In[1]:= | ![]() |
Out[1]= | ![]() |
Test for heads using the operator form:
In[2]:= | ![]() |
Out[2]= | ![]() |
Check for multiple heads with Alternatives:
In[3]:= | ![]() |
Out[3]= | ![]() |
Check the heads of any type of expression:
In[4]:= | ![]() |
Out[4]= | ![]() |
Check heads while holding expressions:
In[5]:= | ![]() |
Out[5]= | ![]() |
By default HeadQ does not prevent evaluation:
In[6]:= | ![]() |
Out[6]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License