AllowedHeads

AllowedHeads

is an option that specifies the heads of subexpressions into which a function may descend.

Details

  • Different functions use different default settings for AllowedHeads.
  • Settings for the AllowedHeads option include:
  • Automaticdefault settings
    Inheritedallow only Head[expr]
    Allallow any normal expression head
    hallow only head h
    {h1,}allow any of h1,

Examples

open all close all

Basic Examples  (4)

Only consider nested expressions with head List:

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

By default, nested expressions with any head are considered arrays:

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

Only consider nested expressions with head List:

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

By default, rectangular nested expressions with any head are considered arrays:

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

Sum inside the outermost head:

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

Sum inside both f and g:

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

Scope  (2)

Applications  (1)

Properties & Relations  (2)

Introduced in 2019
(12.0)