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.
------_ extPart_001_01C0FA73.A25B0130
Content-Type: text/plain;
charset so-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 est.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 est.new do
command proc { |w|
}
end
------_ extPart_001_01C0FA73.A25B0130
Content-Type: text/html;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2652.35">
<TITLE>Possible problem found in version 1.6.3...</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=2 FACE="Arial">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?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">--BEGINING OF bug.rb--</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">class Test</FONT>
<BR> <FONT SIZE=2 FACE="Arial">def initialize(&block)</FONT>
<BR> <FONT SIZE=2 FACE="Arial">instance_eval(&block)</FONT>
<BR> <FONT SIZE=2 FACE="Arial">end</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">def command(p)</FONT>
<BR> <FONT SIZE=2 FACE="Arial">end</FONT>
<BR><FONT SIZE=2 FACE="Arial">end</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">t = Test.new do</FONT>
<BR> <FONT SIZE=2 FACE="Arial">command proc do |w|</FONT>
<BR> <FONT SIZE=2 FACE="Arial">end</FONT>
<BR><FONT SIZE=2 FACE="Arial">end</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">--END OF bug.rb--</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Produces the following error:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">bug.rb:12:in `proc': tried to create Proc object without a block (ArgumentError)</FONT>
<BR> <FONT SIZE=2 FACE="Arial">from bug.rb:12</FONT>
<BR> <FONT SIZE=2 FACE="Arial">from bug.rb:11:in `instance_eval'</FONT>
<BR> <FONT SIZE=2 FACE="Arial">from bug.rb:4:in `instance_eval'</FONT>
<BR> <FONT SIZE=2 FACE="Arial">from bug.rb:4:in `initialize'</FONT>
<BR> <FONT SIZE=2 FACE="Arial">from bug.rb:11:in `new'</FONT>
<BR> <FONT SIZE=2 FACE="Arial">from bug.rb:11</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">If you change the proc block to the following it works:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">t = Test.new do</FONT>
<BR> <FONT SIZE=2 FACE="Arial">command proc { |w|</FONT>
<BR> <FONT SIZE=2 FACE="Arial">}</FONT>
<BR><FONT SIZE=2 FACE="Arial">end</FONT>
</P>
<BR>
<BR>
</BODY>
</HTML>
------_ extPart_001_01C0FA73.A25B0130--