"Christian Szegedy" wrote
....
> Perhaps this is a faq, but I stil don't understand
> the difference between Method and Proc objects.
> Is there some pointer to a doc about the this topic.
> I read the FAQ, but I found nothing.

As far as I can tell the only real difference is in the creation
and the fact that you can  ``unbind'' (rebind) a  Method.


---
class Fixnum
    def foo
        p [self,self + 2]
   end
end

foo3 = 3.method(:foo)

p foo = foo3.unbind

foo4 = foo.bind(4)
foo6 = foo.bind(6)

(proc {|| }).to_proc
foo3[]
foo4[]
foo6[]

class A
  def initialize(x)
    @bar = x
  end
  attr_reader :bar
end

a = A.new "a_foo"
b = A.new "b_foo"
a_bar = a.method(:bar)
b_bar = (a_bar.unbind).bind(b)
proc_bar = proc { || @bar }


@bar = "main_bar"

p a_bar[]
p b_bar[]
A.new ("c_bar").instance_eval {
 p  proc_bar[]
}
---
#<UnboundMethod: Fixnum#foo>
[3, 5]
[4, 6]
[6, 8]
"a_foo"
"b_foo"
"main_bar"
---



/Christoph