Skip to main content
3 of 4
added 87 characters in body
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

Depending on your intentions this may be a duplicate of Mathematica Destructuring but if not:

# + #2 - #3 & @@ {1, 3, 5}

Or

# + #2 - #3 & @@ # & @ {1, 3, 5}

And

Fold[
  Function[{x, y}, If[y < 5, {# ~Join~ {y}, #2}, {#, #2 ~Join~ {y}}] & @@ x],
  {{}, {}},
  Range[10]
]

Similar to Rojo's answer (and my answer to Mathematica Destructuring):

Fold[
  # /. {a_, b_} :> If[#2 < 5, {a ~Join~ {#2}, b}, {a, b ~Join~ {#2}}] &,
  {{}, {}},
  Range[10]
]
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k