1

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!

Chen Stats Yu
  • 4,986
  • 2
  • 24
  • 50

1 Answers1

5

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]
kglr
  • 394,356
  • 18
  • 477
  • 896
Chris Degnen
  • 30,927
  • 2
  • 54
  • 108