From: Michael Sokol Date: 2011-04-29T00:49:55+09:00 Subject: Re: Is everything object ? I think both of you are correct, in that: - Object are tangible things capable of processing -> composed of methods Thus an object isn't an entity that aggregate other entities (method objects). It's a closed, encapsulated, independent thing. However, it'd make sense to treat method as first-class objects. A method is only a procedure bound to an instance. In fact, Ruby allows you to do that: m = my_object.method( :a_method ) # returns a Method object bound to my_object m.call Michael Le 28 avr. 2011 à 11:26, Roger Braun a écrit : > 2011/4/28 Chad Perrin : >> For my purposes at least, it seems perfectly consistent that methods >> should not be objects, in any case. Methods aren't *things*; they're >> techniques *things* use to get stuff done. They are what objects know, >> rather than being objects themselves. > > I can not completely agree with that. One reason why methods should be > objects is because it is great to treat them like this (as the > quasi-method-object called "block" proves) and makes a lot of stuff > easier. Also, you can only bind objects to variables in Ruby, nothing > else. So if I want to use a method in several places that don't know > the method name beforehand, I have to wrap the method in a Proc > object. > BTW, having functions as objects is not really that unusual, see Javascript. > > -- > Roger Braun > rbraun.net | humoralpathologie.de >