From: Joel VanderWerf Date: 2005-01-20T03:39:51+09:00 Subject: Re: is defined? fast? Florian Gross wrote: > Robert Klemme wrote: > >> Personally I never felt the need for defined? - only during my >> initial Ruby stages, when I carried some Perl thinking with me; but >> never after I got rid of that. :-) > > > I always thought it was there mostly for using it in IRB, not in actual > code. (E.g. to ask Ruby how it understands a construct.) > > But it does at least make sense in real code in the defined?(Constant) > case. The following idiom is useful in mixins: module Mixin def meth super if defined?(super) # add some behavior here end end