From: Will Sobel Date: 2001-06-22T01:53:47+09:00 Subject: [ruby-talk:16716] Possible problem found in version 1.6.3... This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C0FA73.A25B0130 Content-Type: text/plain; charset="iso-8859-1" The following code worked in version 1.6.2 but does not work in version 1.6.3. (ruby 1.6.3 (2001-03-19) [i386-cygwin]). Is this intended? --BEGINING OF bug.rb-- class Test def initialize(&block) instance_eval(&block) end def command(p) end end t = Test.new do command proc do |w| end end --END OF bug.rb-- Produces the following error: bug.rb:12:in `proc': tried to create Proc object without a block (ArgumentError) from bug.rb:12 from bug.rb:11:in `instance_eval' from bug.rb:4:in `instance_eval' from bug.rb:4:in `initialize' from bug.rb:11:in `new' from bug.rb:11 If you change the proc block to the following it works: t = Test.new do command proc { |w| } end ------_=_NextPart_001_01C0FA73.A25B0130 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Possible problem found in version 1.6.3...

The following code worked in version = 1.6.2 but does not work in version 1.6.3. (ruby 1.6.3 (2001-03-19) = [i386-cygwin]). Is this intended?

--BEGINING OF bug.rb--

class Test
        def initialize(&block)
        =         instance_eval(&block)
        end

        def command(p)
        end
end

t =3D Test.new do
        command proc do |w|
        end
end

--END OF bug.rb--

Produces the following error:

bug.rb:12:in `proc': tried to create = Proc object without a block (ArgumentError)
        from bug.rb:12
        from bug.rb:11:in `instance_eval'
        from bug.rb:4:in `instance_eval'
        from bug.rb:4:in `initialize'
        from bug.rb:11:in `new'
        from bug.rb:11

If you change the proc block to the = following it works:

t =3D Test.new do
        command proc { |w|
        }
end



------_=_NextPart_001_01C0FA73.A25B0130--