0.instance_eval { def m() :m end }; p 1.m

e$B0J2<$N$h$&$Ke(B 0.m e$B$rDj5A$G$-!"$=$l$re(B 1.m
e$B$H$7$F8F$S=P$;$k$N$Oe(B
[email protected]$H;W$$$^$9!#e(B

% ./ruby -ve ‘0.instance_eval { def m() :m end }; p 1.m’
ruby 1.9.0 (2008-05-02 revision 16276) [i686-linux]
:m

[email protected]$G$9!%e(B

Tanaka A. wrote:

e$B0J2<$N$h$&$Ke(B 0.m e$B$rDj5A$G$-!"$=$l$re(B 1.m e$B$H$7$F8F$S=P$;$k$N$Oe(B
[email protected]$H;W$$$^$9!#e(B

% ./ruby -ve ‘0.instance_eval { def m() :m end }; p 1.m’
ruby 1.9.0 (2008-05-02 revision 16276) [i686-linux]
:m

e$B!!$I$&$7$?$b$s$G$7$g$&!%e(B

  1. 1.8 e$B$HF1MM$Ke(B no class/module to add method (TypeError)
  2. e$B$3$N$^$^e(B

e$B!!$d$O$j!$e(B1 e$B$+$J$!!%e(B

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

In message “Re: [ruby-dev:34737] Re: 0.instance_eval { def m() :m end };
p 1.m”
on Sun, 18 May 2008 15:33:27 +0900, SASADA Koichi [email protected]
writes:

|e$B!!$I$&$7$?$b$s$G$7$g$&!%e(B
|
|1) 1.8 e$B$HF1MM$Ke(B no class/module to add method (TypeError)
|2) e$B$3$N$^$^e(B
|
|e$B!!$d$O$j!$e(B1 e$B$+$J$!!%e(B

e$B;DG0$J$,$ie(B2e$B$O$J$$$G$7$g$&$M!#$3$N$^$^$+!"e(Bimmediatee$B$G$bFC0[%ae(B
e$B%=%C%I$r5v$9$+$I$A$i$+$G$7$g$&!#e(B

undere$B$Ke(Bsingleton
classe$B$NBe$o$j$Ke([email protected]$s$G!“e(Bdefinemethode$B$Ge(B
SPECIAL_CONST_Pe$B$GJ,[email protected]$&<j$r9M$($?$s$G$9$,!”$3$3$O$h$/e(B
e$B$F$be(Bqetconstante$B$Ge(Bnile$B$rFCJL07$$$7$F$k$s$G$9$h$M$(!#e(B

getconstante$B$K%%Z%i%s%Ie(B(basee$B$r;XDj$7$F$$$k$+$I$&$+e(B)e$B$rDI2C$9e(B
e$B$k$H$$$&$N$b9M$($?$s$G$9$,$$$+$K$b$
$*$2$5$G$9$7$M$(!#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