Skip to main content
Tweeted twitter.com/#!/StackMma/status/459566056462635008
added 277 characters in body
Source Link
mfvonh
  • 8.5k
  • 27
  • 43

How does one manipulate the slot numbers in a pure function? Some trick with Evaluate or Hold? I'm aiming for something along the lines of:

(Slot /@ Range[19, 164, 29])& @@ {...}

EDIT

It turns out my actual problem is: why does

Evaluate[{Slot /@ Range[19, 164, 29]}] & @@ Range[164]

yield {{19, 48, 77, 106, 135, 164}} but

{Evaluate[Slot /@ Range[19, 164, 29]]} & @@ Range[164]

yields {{#19, #48, #77, #106, #135, #164}}?

How does one manipulate the slot numbers in a pure function? Some trick with Evaluate or Hold? I'm aiming for something along the lines of:

(Slot /@ Range[19, 164, 29])& @@ {...}

How does one manipulate the slot numbers in a pure function? Some trick with Evaluate or Hold? I'm aiming for something along the lines of:

(Slot /@ Range[19, 164, 29])& @@ {...}

EDIT

It turns out my actual problem is: why does

Evaluate[{Slot /@ Range[19, 164, 29]}] & @@ Range[164]

yield {{19, 48, 77, 106, 135, 164}} but

{Evaluate[Slot /@ Range[19, 164, 29]]} & @@ Range[164]

yields {{#19, #48, #77, #106, #135, #164}}?

Source Link
mfvonh
  • 8.5k
  • 27
  • 43

Manipulating slots in a pure function

How does one manipulate the slot numbers in a pure function? Some trick with Evaluate or Hold? I'm aiming for something along the lines of:

(Slot /@ Range[19, 164, 29])& @@ {...}