I'd like /@
instead of Table
or Map
.
But let we have it inside pure function:
{#1, (#1 + #) & /@ #2} &[a, {b, c, d, e, ...}]
It is assumed that the second #1
should be the same as first - a first argument of a main function. So output should be:
{a, {a + b, a + c, ...}}
But of course according to the rules of Wolfram Language
the second #1
stands for first argument of inner function, so output is:
{a, {2 b, 2 c, 2 d, ...}}
Is it possible to avoid Table in this case?
Clarification
In documentation there is an example: Horner nested polinomial:
Fold[x #1 + #2 &, 0, {a, b, c, d, e}]
I need a pure function instead of function of x, and short (for code-golf challenges). The ways suggested in the answers are not suitable in this case.
{#1, #1 + #2} &[a, {b, c}]
$\endgroup$Function
with named arguments. $\endgroup$