From: "John Lam (CLR)" Date: 2007-06-29T05:43:14+09:00 Subject: Proc initialize method not called under certain circumstances --_000_372109E149E8084D8E6C7D9CFD82E06329CECEF1DFNAEXMSGC115re_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable class Proc def initialize puts 'initialized' end end def foo &p puts p end Proc.new {} # prints "initialized" foo { } # prints nothing lambda {} # prints nothing Is this expected behavior? Thanks, -John --_000_372109E149E8084D8E6C7D9CFD82E06329CECEF1DFNAEXMSGC115re_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

class Proc

  def initialize

    puts 'initialized'

  end

end

 

def foo &p

  puts p 

end

 

Proc.new {}   # prints "initialized&quo= t;

foo { }       # prints n= othing

lambda {}     # prints nothing

 

Is this expected behavior?

 

Thanks,

-John

 

--_000_372109E149E8084D8E6C7D9CFD82E06329CECEF1DFNAEXMSGC115re_--