From: Daniel DeLorme Date: 2007-05-25T20:59:45+09:00 Subject: Re: Replacement idiom for "list_or_nil.to_a"? Rich Morin wrote: > will fail. As a workaround, I've been using this idiom: > > list_or_nil.to_a.each do |value| > ... > end > > However, I gather that this will soon be deprecated: Object#to_a will be deprecated but not nil.to_a, so the idiom you have above works just fine. It will break if list_or_nil is a non-array non-nil value but I think that's as it should be. Daniel