From: Martin DeMello Date: 2003-01-18T07:28:33+09:00 Subject: Re: quick: it responds, it evaluates, and is not empty ahoward wrote: > On Sat, 18 Jan 2003, Tom Sawyer wrote: > >> but this does not free one from using respond_to? i.e. instead of: if >> respond_to?(:x), one would simply say: if x != nack. > > i see your point, but see my post to david. in general i love syntax > shortcuts, but i'm not comfortable about that because it hide exception > throwing... The point, though, is to return a nack *instead of* throwing an exception. For speed, if nothing else. > i actually like that one (someone suggested it earlier). it's short and > ignores exceptions, but it would be patently clear to anyone reading the code > that missing methods do not throw exceptions. That was mine. The problem, though, is that anyone writing their own method_missing has to explicitly remember to call super. I know it'd break Ruby's model, but there are times I think it'd be really convenient if method_missing was treated as a special case, and behaved more like, say, a multimethod. martin