0
$\begingroup$

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$
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]

| improve this answer | |
$\endgroup$

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