ComapApply
ComapApply[{f1,f2,…},expr]
ComapApply[fs]
represents an operator form of ComapApply that can be applied to an expression.
Details and Options
- ComapApply is typically used to apply each of a list of functions to the same sequence of arguments. »
- With the option setting HeadsTrue, ComapApply includes heads of expressions and their parts. »
- ComapApply always effectively constructs a complete new expression and then evaluates it. »
- The head of fs in ComapApply[fs,expr] need not be List.
- If fs is an Association object, ComapApply[fs,expr] replaces the head of expr with the values in the association. »
- ComapApply[fs][expr] is equivalent to ComapApply[fs,expr].
- Parallelize[ComapApply[fs,expr]] computes ComapApply[fs,expr] in parallel on all subkernels. »
Examples
open allclose allBasic Examples (3)
Replace the head of {1,2} with each element of a list:
Use the operator form of ComapApply:
Replace the head of an expression with the values in an association:
Scope (3)
ComapApply can be used on expressions with any head:
Replace the head of an expression with the values of an Association:
Properties & Relations (8)
ComapApply successively replaces the head of an expression with the parts of another expression:
MapApply replaces the head of each part of an expression with another expression:
Through[p[f,g,…][x,y,…]] is equivalent to ComapApply[p[f,g,…],{x,y,…}]:
Compare this to the operator form of ComapApply:
ComapApply[p[f,g,…],{x,y,…}] can be used even when p[f,g,…][x,y,…] has a value:
When p[f,g,…][x,y,…] has a value, Through cannot be used:
ComapApply[{f1,f2,…},expr] is equivalent to Map[f ->Apply[f,expr],{f1,f2,…}] when the fi have no attributes:
ComapApply can replace the head of an expression with parts inside held expressions without allowing evaluation to proceed:
Use ReleaseHold to allow evaluation to proceed:
If only some arguments are held, only those arguments will not evaluate further:
Use Unevaluated to replace the head of an expression with different expressions without evaluating it first:
The expression is evaluated first by default:
Use Unevaluated to replace the head of an expression with the parts of an expression without evaluating it first:
The expression is evaluated first by default:
ComapApply can be parallelized automatically:
Text
Wolfram Research (2024), ComapApply, Wolfram Language function, https://reference.wolfram.com/language/ref/ComapApply.html.
CMS
Wolfram Language. 2024. "ComapApply." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ComapApply.html.
APA
Wolfram Language. (2024). ComapApply. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ComapApply.html