Thread
f applied elementwise across every list-headed argument, other arguments broadcast.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Thread✓Thread(f(a1, …, an))f threaded over every List-headed operandThread(f(a1, …, an), h)like Thread(f(...)), threading only over operands headed by h instead of ListTyped signatures
| Type | Package | Applies |
|---|---|---|
(any, symbol?) -> any | combinatorics | always |
Details
- Operands not headed by h are broadcast unchanged to every threaded call.
- The operands are evaluated first, and a lazy ordered collection such as threads as the List it evaluates to. The threaded calls themselves are left as built, not evaluated.
- Left unevaluated when the h-headed operands don't all share one length.
- Many arithmetic heads already thread over lists automatically; Thread's value is threading a head that doesn't, such as Equal or a plain function.
Examples
Scope #
Applications #
About
| Examples | 10 |
|---|---|
| Checked against | Wolfram Language 10 agree |
| Crosswalk | Wolfram Language |