This question is related to:
Composition of functions using slots
`Slot` (#) interfering with evaluation
Consider a toy example:
list1 = { {a1, b1, c1, d1}, {a2, b2, c2, d2}, {a3, b3, c3, d3} };
I’d like to take elements from the list as follows example:
{#1, #2}@@@ list1
But I’d like to able to define #1, #2 programmatically.
I tried:
n=1;
{Slot@Evaluate[n], Slot@Evaluate[n + 1]} & @@@ list1
But it gives me an error…
Answers appreciated.Even better if the answer uses the # notation rather than the Slot function.
With[{n = n},...]was also allowed. – Teake Nutma Jul 17 '14 at 11:41Wherein V10 see my answer. – RunnyKine Jul 17 '14 at 11:43