Should ObjectSpace.each_object return an enumerator or not?

Yuguie$B$H$$$$$^$9!#e(B

ObjectSpace.each_objecte$B$,e(BEnumeratore$B$rJV$5$J$$$N$O;EMM$Ge(B
e$B$7$g$&$+e(B?
e$B2a5n%m%0$r;2>H$7$^$7$?$,!"e(BEnumeratore$B$rJV$9$Y$-%$%F%l!<%?$He(B
e$B$=$l0J30$K$D$$$Fe(B
e$B4p=`$,$h$/J,$+$i$J$+$C$?$N$G!"E*$r30$7$F$*$j$^$7$?$i$4$a$s$J$5$$!#e(B

% ./ruby-1.9.0-0 -ve ‘p ObjectSpace.each_object(Class)’
ruby 1.9.0 (2007-12-25 revision 0) [i686-darwin8.11.1]
-e:1:in each_object': no block given (LocalJumpError) from -e:1:in

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

In message “Re: [ruby-dev:32828] Should ObjectSpace.each_object return
an enumerator or not?”
on Thu, 27 Dec 2007 22:13:22 +0900, Yugui [email protected]
writes:

|ObjectSpace.each_objecte$B$,e(BEnumeratore$B$rJV$5$J$$$N$O;EMM$Ge(B
|e$B$7$g$&$+e(B?

e$B$$$$$(!"JV$7$?J}$,$h$$$G$9$M!#D>$7$F$*$-$^$9!#e(B
e$BIw<Y$,<#$C$?$i!#e(B

Yuguie$B$G$9!#e(B

On 2007/12/27, at 23:30, Yukihiro M. wrote:

e$B$$$$$(!"JV$7$?J}$,$h$$$G$9$M!#D>$7$F$*$-$^$9!#e(B
e$BIw<Y$,<#$C$?$i!#e(B

e$B$*Iw<Y$G$9$+!#$*Bg;v$K!#e(B

e$B0J2<$O%Q%C%A$G$9!#e(BRETURN_ENUMERATORe$B$OJXMx$G$9$M!#e(B

Index: gc.c

— gc.c (revision 14746)
+++ gc.c (working copy)
@@ -1798,7 +1798,7 @@
*/

static VALUE
-os_each_obj(int argc, VALUE *argv)
+os_each_obj(int argc, VALUE *argv, VALUE os)
{
VALUE of;

@@ -1806,6 +1806,7 @@
if (rb_scan_args(argc, argv, “01”, &of) == 0) {
of = 0;
}

  • RETURN_ENUMERATOR(os, argc, argv);
    return os_obj_of(of);
    }

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