From: "Aleksi Niemelä" Date: 2001-01-20T19:43:24+09:00 Subject: [ruby-talk:9597] Re: 101 Misconceptions About Dynamic Languages Josh Stern comments someone else comment about Ruby's first-class objects: >> Ruby does not have functions as first-class objects. You cannot pass a >> function as an argument, nor return one as a result. > > > At http://www.ruby-lang.org/en/compar.html, Matz says > "Ruby's functions (methods) are not first class objects" > but I don't understand this point, actually. Ruby does > have the 'Proc' class which is a function object. > Just like in C++, an instance method requires object to use > it. However, one can easily pass tuples of > , , > , etc. > which amounts to the same thing in Ruby because the thing > that is invoked by a function call in the language > is 'the thing bound to that name', not a hunk of > code at a machine address. I'd like to note that Ruby has Method class. You can check it's workings from http://www.rubycentral.com/ref/ref_c_object.html#method and http://www.rubycentral.com/ref/ref_c_method.html The main thing is there's already a class to represent the tuple you mention, it's tied to all objects (through Object), and it works nicely with procs. - Aleksi