Group Abstract Group Abstract

Message Boards Message Boards

A better way to supply the elements of a list as arguments to a function ..

Attachments:
POSTED BY: Mark Tuttle
2 Replies

Yes, thank you!

Sequence @@

Is what I was trying to remember; I forgot it was a two-step thing - replace the head of the list with Sequence and then execute Sequence.

Couldn't get there using Help.

-- Mark

POSTED BY: Mark Tuttle

Could define a transition function that explicitly makes the list into a sequence.

f = BooleanFunction[1, 2];
tt = Tuples[{False, True}, 2];
f[#[[1]], #[[2]]] & /@ tt
g[ll_List] := f[Sequence @@ ll]
g /@ tt

{True, False, False, False}

{True, False, False, False}

{True, False, False, False}
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard