On Fri, Mar 25, 2011 at 7:52 AM, Robert Klemme
<shortcutter / googlemail.com> wrote:
> What about
> ...
> res = [1]
> [a,b,c].each {|x| x and res.concat x}

I'd also wondered whether Iain Barnett really needed array + array2
rather than array.concat(array2), and wondered about something
similar:

class Array
  def concat_not_nil( *args )
    args.each { |arg| concat(arg) unless arg.nil? }
    self
  end
  def plus_not_nil( *args )
    new_ary = self.dup
    new_ary.concat_not_nil( *args )#
  end
end