Most list manipulations can be done with Flatten, Partition and Take. I didn't managed to use them for my need: I'd like to know if there is nice solution to map a function of several variables to a list, and other variables. For examples, given:
f[a_,b_,c_]=a+b+c;
and
list={2,3};
I'd like to calculate f[a,2,3]
Of course, I could use
f[a,list[[1]],list[[2]]]
but I'm looking for something a bit more general, such as
f[a,MysteriousFunction[list]]
(* wished output: a+1+2 *)
Does such a MysteriousFunction exist?
f[a, Sequence@@list/. 2->4]doesn't work, butf[a, Sequence@@Sequence@@list/. 2->4]does. There's probably a simpler way but I didn't find it yet. – anderstood Aug 12 '14 at 18:08Sequence@@...rather thanSequence[...]? – anderstood Aug 12 '14 at 18:09f[a, Sequence @@ (list /. 2 -> 4)]– Dr. belisarius Aug 12 '14 at 18:13@@to replace the headListbySequence...Sequence[{1, 2}] != Sequence @@ {1, 2}– Dr. belisarius Aug 12 '14 at 18:30