On Mon, Jun 28, 2004 at 06:52:57PM +0900, gabriele renzi wrote:
> >> a.sort_by &(Array.instance_method(:size))
> TypeError: wrong argument type UnboundMethod (expected Proc)

Florian Gro? (flgr) thought of using #to_proc some time ago, something
like:

batsman@tux-chan:/tmp$ cat dfgdfgw4e5t6dsegb.rb

class Symbol
    def to_proc
        lambda{|x| x.method(self).call }
    end
end

a = %w[sdf dsfsdferrt4we dsfdfg dfg dfgdf gdf gdf gdfg]
p a
p a.sort_by(&:size)
batsman@tux-chan:/tmp$ ruby dfgdfgw4e5t6dsegb.rb
["sdf", "dsfsdferrt4we", "dsfdfg", "dfg", "dfgdf", "gdf", "gdf", "gdfg"]
["sdf", "gdf", "gdf", "dfg", "gdfg", "dfgdf", "dsfdfg", "dsfsdferrt4we"]



-- 
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

<Skyhook> Where is 'bavaria' proper?  I thought it was austria.
	-- Seen on #Linux