From: Robert Klemme Date: 2003-09-11T16:31:46+09:00 Subject: Re: What *are* variables? Which are nil now? "Hugh Sasse Staff Elec Eng" schrieb im Newsbeitrag news:Pine.GSO.4.53.0309110023200.26201@neelix... > I found out what caused it: > @dirs += entries.collect{|f| stuff_here(f)}.compact! > > The bang method caused the blow up, but even defining > > class Nil > def to_a > raise "nil.to_a() called" > end > end > > did not trap it. > Where does the "#<"..."failed to convert nil to Array"...> > message come from? Somewhere untrappable? Since @dirs += entries.collect{|f| stuff_here(f)}.compact! <=> @dirs = ( @dirs + entries.collect{|f| stuff_here(f)}.compact! ) Assuming that @dirs is an Array, Array.+ tries to convert the argument (which is the result of the expr right to the "+") to an Array and throws the exception Cheers robert