Skip to content

Attributes ​

The Wolfram-named properties compute-engine tracks for a head's operator.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageAttributes!
Attributes(f)The subset of {Flat,HoldAll,Listable,Orderless}\{Flat, HoldAll, Listable, Orderless\} ff's operator definition carries, and ProtectedProtected for a declared head, alphabetically.
Typed signatures
TypePackageApplies
(symbol) -> list<symbol>combinatoricsalways

Domain: Collections

Details
  • Maps compute-engine's own operator flags to the closest genuine Wolfram attribute name, and no further: associative→Flatassociative \to Flat, lazy→HoldAlllazy \to HoldAll, broadcastable→Listablebroadcastable \to Listable, commutative→Orderlesscommutative \to Orderless.
  • Compute-engine's idempotent and involution flags are deliberately excluded: real algebraic properties it tracks for pattern matching, but not Wolfram Attributes names — Wolfram has no such entries, so reporting them would claim a fact that doesn't exist.
  • HoldAll for lazy is an approximation: compute-engine's lazy means "operands arrive unevaluated", the effect of Wolfram's HoldAll without distinguishing it from HoldFirst/HoldRest/HoldAllComplete.
  • Protected is reported for every head we declare — compute-engine's own and every package's — and for no symbol of your own. Nothing sets or clears it: SetAttributes and ClearAttributes refuse on a protected head.
  • An undeclared symbol reads as no attributes.

Examples

Basic #

Add is Flat, HoldAll, Listable and Orderless on this engine, and Protected like every declared head

live ↗
InAttributes(Add)\mathrm{Attributes}(\mathrm{Add})Out[Flat,HoldAll,Listable,Orderless,Protected]\bigl\lbrack\mathrm{Flat}, \mathrm{HoldAll}, \mathrm{Listable}, \mathrm{Orderless}, \mathrm{Protected}\bigr\rbrack

An undeclared symbol has no attributes

live ↗
InAttributes(f)\mathrm{Attributes}(f)Out[]\bigl\lbrack\bigr\rbrack
Properties #

A symbol with nothing set returns an empty list

live ↗
InAttributes(syms)\mathrm{Attributes}(\mathrm{syms})Out[]\bigl\lbrack\bigr\rbrack
live ↗
InAttributes(Attributes)\mathrm{Attributes}(\mathrm{Attributes})Out[HoldAll,Protected]\bigl\lbrack\mathrm{HoldAll}, \mathrm{Protected}\bigr\rbrack
About
Examples4
Checked againstWolfram Language 2 agree2 differ
CrosswalkWolfram Language

See also: SetAttributes, ClearAttributes