Range#min ignores block

e$B1sF#$H?=$7$^$9!#e(B

Range#min e$B$de(B #max e$B$K%V%m%C%/$rEO$7$F$bL5;k$5$l$^$9!#e(B

$ ./ruby -ve ‘p((1…10).min { exit })’
ruby 1.9.0 (2008-02-04 revision 15375) [i686-linux]
1

e$B860x$Oe(B rb_call_super
e$B$G%V%m%C%/$,0z$-7Q$,$l$J$$$;$$$N$h$&$G$9!#e(B

e$B>e$NNc$G$O!"e(B

  • Range#min e$B$O%V%m%C%/$,M?$($i$l$?;[email protected]$1e(B rb_call_super
    e$B$r8F$Ve(B
  • e$B$3$N$H$-%V%m%C%/$N0z$-7Q$.$,$5$l$J$$e(B
  • Enumerable#min e$B$,%V%m%C%/$J$7$G8F$S=P$5$l$ke(B
    e$B$H$$$&Iw$KF0$$$F$$$k$h$&$G$9!#e(B

e$B$I$3$G%V%m%C%/$r0z$-7Q$0$N$,@5$7$$$N$+$o$+$j$^$;$s$,!"$?$H$($Pe(B
e$B0J2<[email protected]$G$A$c$s$HF0$/$h$&$K$J$j$^$7$?!#e(B

Index: vm.c

— vm.c (revision 15371)
+++ vm.c (working copy)
@@ -536,6 +536,7 @@
VALUE
rb_call_super(int argc, const VALUE *argv)
{

  • PASS_PASSED_BLOCK();
    return vm_call_super(GET_THREAD(), argc, argv);
    }

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:33598] Range#min ignores block”
on Mon, 4 Feb 2008 22:06:36 +0900, “Yusuke ENDOH” [email protected]
writes:

|Range#min e$B$de(B #max e$B$K%V%m%C%/$rEO$7$F$bL5;k$5$l$^$9!#e(B

|e$B860x$Oe(B rb_call_super e$B$G%V%m%C%/$,0z$-7Q$,$l$J$$$;$$$N$h$&$G$9!#e(B
|
|e$B>e$NNc$G$O!“e(B
| - Range#min e$B$O%V%m%C%/$,M?$($i$l$?;[email protected]$1e(B rb_call_super e$B$r8F$Ve(B
| - e$B$3$N$H$-%V%m%C%/$N0z$-7Q$.$,$5$l$J$$e(B
| - Enumerable#min e$B$,%V%m%C%/$J$7$G8F$S=P$5$l$ke(B
|e$B$H$$$&Iw$KF0$$$F$$$k$h$&$G$9!#e(B
|
|e$B$I$3$G%V%m%C%/$r0z$-7Q$0$N$,@5$7$$$N$+$o$+$j$^$;$s$,!”$?$H$($Pe(B
|e$B0J2<[email protected]$G$A$c$s$HF0$/$h$&$K$J$j$^$7$?!#e(B

rb_call_super()e$B$,%V%m%C%/$r<u$1EO$9J}$,K>$^$7$$$h$&$G$9$M!#e(B
e$B%3%_%C%H$7$F$/[email protected]$5$$!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs