From: Jamis Buck Date: 2003-12-16T05:22:28+09:00 Subject: Re: UnboundMethods Useless? T. Onoma wrote: >If I can only bind the method to an object of the same class from which I took >it, then what's the point!? What am I missing? > >T. > > I believe the idea is something like this: you have a class A and an array of instances of A. You then want to call a method on each of the instances, so you grab an unbound instance of the method you want to call, iterate over the array and bind it successively to each member of the array, and call it. Yah, in this case, it's much easier just to use 'each' or something. And I have to admit there have been more times that I've wished I could bind an arbitrary object to an unbound method... -- Jamis Buck jgb3@email.byu.edu ruby -h | ruby -e 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'