0
$\begingroup$

This question already has an answer here:

From the help page:

f[a, Sequence[b, c], d]

No problem at all.

ans = {2, 3, 23, 2, 3412, 421};
ans = Drop[ans, {1, 2}];
f[{a, b}, c, {d, f, g}, Sequence[ans]]

Not working?

f[{a, b}, c, {d, f, g}, Sequence[ans[[3 ;;]]]]

Does not work either.I expect something like this

f[{a, b}, c, {d, f, g},23, 2, 3412, 421]

How would I use Sequence in this case?

Thanks!

$\endgroup$

marked as duplicate by Mr.Wizard Oct 13 '14 at 6:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$

ans is a list so you need to apply sequence.

ans = {2, 3, 23, 2, 3412, 421};
ans = Drop[ans, {1, 2}]
f[{a, b}, c, {d, f, g}, Sequence @@ ans]

f[{a, b}, c, {d, f, g}, 23, 2, 3412, 421]

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.