Hacker News new | ask | show | jobs
by jdcarr 2840 days ago
Ruby works out pretty nicely in that case!

  def order_list_by_predicate(l, &blk)
    l.partition{|i| blk.call(i)}.flatten
  end

  part(1..6) do |i|
    i % 2 == 1
  end
And you can always sort the incoming list if that's a requirement.