From: "David A. Black" Date: 2003-12-17T23:06:17+09:00 Subject: Re: UnboundMethods Useless? On Wed, 17 Dec 2003, T. Onoma wrote: > On Wednesday 17 December 2003 01:59 pm, ts wrote: > > >>>>> "T" == T Onoma writes: > > > > T> Expectations' are precisely the point. > > > > If you expect something else than a coredump, then probably there is > > something that you have not yet found. > > Why Guy? In lisp you can move functions around til the cows come home. I'm > guessing that given your remarks that there's something going on in Ruby's > evaluation of method definitions that make them irreversible, i.e. incapable > of being pulled from the binding context and bound to another. If that is the > case then I would suggest that perhaps it would not be unwise for someone as > capabale as yourself to consider how one might preserve reversibility in > order to vanquish this limitation. I don't know what you mean by (ir)reversible, but the point is that it's meaningless to talk about arbitrary objects being able to do arbitrary things. For example (and Guy has already given some), String#strip removes whitespace. What would it mean to remove whitespace from a Hash or a Fixnum or a MyThing? And more to the point, what would happen if I don't mean: "Could such objects have some method called 'strip' which made sense for them?" because that's not what you're suggesting. What you're suggesting is that String#strip, Array#join, Thread#join, IO#readlines, Regexp.escape, MyThing#some_method, and every other method written for any purpose in Ruby should, without change or adaptation, work for any Ruby object. David -- David A. Black dblack@wobblini.net