From: Gavin Sinclair Date: 2004-05-13T07:36:54+09:00 Subject: Re: Proposal: Object#send(nil) -> self On Thursday, May 13, 2004, 1:10:03 AM, Hal wrote: > I suppose it makes sense if you think of 'obj.x' and then imagine > stripping off the '.x' -- but in the explicit sense of sending a message > via #send, it seems counter-intuitive. Why shouldn't obj.send(nil) just > return nil, for instance? The typical message sent to an object does not > result in that same object or even an object of that class (yes, > sometimes, but not always). > Anyhow, I can see that obj.send(:self) might make a kind of sense, but > I don't know that it would help the original poster. (Was that you??) Original poster was me, and I accept that #self(nil) is unpopular, and I agree there's something wrong with it. And yes, #send(:self) would help me, and appeals to me aesthetically as well. But I doubt the name is acceptable. So what about (courtesy of Sascha) class Object def yourself self end end ... xyz.send(:yourself) # and of course xyz.yourself I don't care much for the name, but it's a Smalltalk thing, and unless Smalltalk people think it sux, then it probably grows on you. At least it is unlikely to conflict with a user's class; who has ever created a method called 'yourself'? So, OP is satisfied, and we can probably wrap this thread up now :) Cheers, Gavin