From: David Alan Black Date: 2002-04-11T06:37:08+09:00 Subject: RE: OO/Ruby Terminology On Thu, 11 Apr 2002 james@rubyxml.com wrote: > > From: David Alan Black [mailto:dblack@candle.superlink.net] > > > > I guess I'd tend to think of it as *trying* to call my_foo's bar > > method -- as opposed to being a case of message-sending that has no > > connection to method-calling. #method_missing is sort of in the > > exception-handler family, at least in spirit. If in every other > > respect it were the case that message == method, then I wouldn't think > > the existence of method_missing would change that. > > Does that suggest that (generally) one shouldn't define object behavior > using a dynamic response to messages, but should better define specific > methods, and use method_missing to gracefully fail? I didn't mean to sound prescriptive (proscriptive? well, neither :-) I'm just looking at it specifically from the point of view of the method/message relation, and the question of how to characterize and/or explain that relation. I think of #method_missing (however it's used, in the program's structure) as a fall-through thing (though not necessary a failure thing), which is why I mention exceptions in the same breath. Interesting that it isn't called #message_not_understood :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav