Forums » Ruby-dev » test_callbacks(TestWEBrickServer) error

test_callbacks(TestWEBrickServer) error
Posted by GOTOU Yuuzou (Guest)
on 30.06.2006 13:05
1.9$B$G%V%m%C%/%Q%i%a!<%?$NEO$5$l$+$?$,JQ$o$C$?$?$a$K!"(B
test/webrick/test_server.rb $B$J$I4v$D$+$N%F%9%H$,%Q%9$7$J$/$J$C(B
$B$F$$$^$9!#$I$&$7$^$7$g$&!#(B

% ruby-1.8 -ve '
def foo(&block)
  block.call([1,2])
end
foo{|a, b| p [a, b]}
'
ruby 1.8.5 (2006-06-29) [i386-netbsd]
[1, 2]

% ruby-1.9 -ve '
def foo(&block)
  block.call([1,2])
end
foo{|a, b| p [a, b]}
'
ruby 1.9.0 (2006-06-29) [i386-netbsd]
[[1, 2], nil]
Re: test_callbacks(TestWEBrickServer) error
Posted by Yukihiro Matsumoto (Guest)
on 30.06.2006 15:41
$B$^$D$b$H(B $B$f$-$R$m$G$9(B

In message "Re: [ruby-dev:28914] test_callbacks(TestWEBrickServer) 
error"
    on Fri, 30 Jun 2006 20:04:33 +0900, GOTOU Yuuzou 
<gotoyuzo@notwork.org> writes:

|1.9$B$G%V%m%C%/%Q%i%a!<%?$NEO$5$l$+$?$,JQ$o$C$?$?$a$K!"(B
|test/webrick/test_server.rb $B$J$I4v$D$+$N%F%9%H$,%Q%9$7$J$/$J$C(B
|$B$F$$$^$9!#$I$&$7$^$7$g$&!#(B

call$B$NBe$o$j$K(Byield$B$r;H$C$F$/$@$5$$!#(B

% ruby -ve '
def foo(&block)
  block.yield([1,2])
end
foo{|a, b| p [a, b]}
'
ruby 1.9.0 (2006-06-29) [i686-linux]
[1, 2]