I'm trying to apply a simple function to the second element of a list:
{#1, #2/5} &@{1, 2}
But this returns an error message.
Function::slotn: "Slot number 2 in {#1,#2/5}& cannot be filled from ({#1,#2/5}&)[{1,2}]."
What is the correct syntax ?
{#1, #2/5} &[1, 2]or{#1, #2/5} & @@ {1, 2}– garej Feb 28 '16 at 15:38{#1, #2/5} & @@ {1, 2}or{#[[1]], #[[2]]/5} &@{1, 2}– Bob Hanlon Feb 28 '16 at 15:44MapAt[#/5&, {1, 2}, 2]– Mr.Wizard Feb 28 '16 at 16:05Apply[{#1, #2/5} &]@{1, 2}– garej Feb 28 '16 at 16:18