From: james@... Date: 2002-04-11T06:29:15+09:00 Subject: RE: OO/Ruby Terminology > From: David Alan Black [mailto:dblack@candle.superlink.net] > > > > With Ruby, I can have > > #----------------- > > class Foo > > def method_missing(methID, args=nil) > > methID.id2name > > end > > end > > > > my_foo = Foo.new > > puts my_foo.bar # Acts as if there is a bar method > > #----------------- > > > > > > I'm inclined to think it incorrect to say that that the code is calling > > my_foo's bar method. > > Am I being pedantic, or wrong? > > 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? James > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav > >