Hi,
In message "[ruby-talk:10467] overriding NameError exception"
on 01/02/07, "Joseph McDonald" <joe / vpop.net> writes:
|However, if I wanted to globally override the NameError
|exception handling to do something like:
|
|if the object is a hash element and nil, and method is +=,
|make it a number, set it to 0 and redo the operation, otherwise
|do the normal NameError procedure.
|
|How could it be done?
How about the following?
class NilClass
def +(other)
other
end
end
although it does not override the exception handling.
matz.