Patch for Struct.new(0)

e$B%o%J%Y$H?=$7$^$9!#e(B

Struct.new(0)e$B$G!"e(BBUG
e$B$GMn$A$:$KNc30$rHt$P$9%Q%C%A$r=q$-$^$7$?!#e(B

Index: struct.c

— struct.c (revision 16278)
+++ struct.c (working copy)
@@ -322,14 +322,14 @@
ID id;

 rb_scan_args(argc, argv, "1*", &name, &rest);
  • if (!NIL_P(name) && TYPE(name) != T_STRING) {
  • rb_ary_unshift(rest, name);
  • name = Qnil;
  • }
    for (i=0; i<RARRAY_LEN(rest); i++) {
    id = rb_to_id(RARRAY_PTR(rest)[i]);
    RARRAY_PTR(rest)[i] = ID2SYM(id);
    }
  • if (!NIL_P(name) && SYMBOL_P(name)) {
  • rb_ary_unshift(rest, name);
  • name = Qnil;
  • }
    st = make_struct(name, rest, klass);
    if (rb_block_given_p()) {
    rb_mod_module_eval(0, 0, st);

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

In message “Re: [ruby-dev:34594] patch for Struct.new(0)”
on Mon, 5 May 2008 16:43:40 +0900, wanabe [email protected]
writes:

|Struct.new(0)e$B$G!"e(BBUG e$B$GMn$A$:$KNc30$rHt$P$9%Q%C%A$r=q$-$^$7$?!#e(B

e$B<h$j9~$$^$9!#$=$m$=$m%o%J%Y$5$s$K%3%%C%H8"$r$"$2$?$$e(B…e$B!#e(B

e$B%o%J%Y$G$9!#e(B

2008/05/05 19:24 Yukihiro M. [email protected]:

e$B<h$j9~$$^$9!#$=$m$=$m%o%J%Y$5$s$K%3%%C%H8"$r$"$2$?$$e(B…e$B!#e(B

e$B>/$7I]$$5$$b$7$^$9$,!“C;$$%Q%C%A$NO"Ej$P$+$j$G5$$,0z$1$F$-$?$N$Ge(B
e$BD:$1$k$J$i$P$”$j$,$?$/D:BW$7$^$9!#e(B

e$B$($($H!“e(Bssh2e$B$N8x3+80$rMQ0U$7$Fe(Bcvs-admine$B$K%a!<%k!”$G$$$$$s$G$7$g$&$+!#e(B

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

In message “Re: [ruby-dev:34597] Re: patch for Struct.new(0)”
on Tue, 6 May 2008 14:35:53 +0900, wanabe [email protected]
writes:

|2008/05/05 19:24 Yukihiro M. [email protected]:
|> e$B<h$j9~$$^$9!#$=$m$=$m%o%J%Y$5$s$K%3%%C%H8"$r$"$2$?$$e(B…e$B!#e(B
|
|e$B>/$7I]$$5$$b$7$^$9$,!“C;$$%Q%C%A$NO"Ej$P$+$j$G5$$,0z$1$F$-$?$N$Ge(B
|e$BD:$1$k$J$i$P$”$j$,$?$/D:BW$7$^$9!#e(B
|
|e$B$($($H!“e(Bssh2e$B$N8x3+80$rMQ0U$7$Fe(Bcvs-admine$B$K%a!<%k!”$G$$$$$s$G$7$g$&$+!#e(B

e$B$=$&$G$9!#e(Bpgpe$B$G%5%$%s$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