Define === for some classes

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

e$BDs0F!'e(B
e$B!!$$$/$D$+$N%/%i%9!"Nc$($Pe(B Fixnum e$B$de(B Bignume$B!"e(BSymbol
e$B$de(B String e$B$J$I$Ke(B ===
e$B$rDj5A$7$F$b$$$$$G$7$g$&$+!#e(B

e$BM}M3!'e(B
e$B!!e(Bcase/when e$B$N:GE,2=$N$?$a$K!"8=:_!"2DG=$J$ie(B ===
e$B$r8F$S=P$5$J$$$h$&$K$7e(B
e$B$F$$$^$9!#Nc$($P!“e(Bwhen
e$B$G$R$C$+$1$k>r7o$,A4It%7%s%%k$d$i?tCM$d$i!”$N;~e(B
e$B$G$9!#e(B

[email protected]!"%7%s%%k$d$i?tCM$d$i$Ke(B === e$B$,Dj5A$5$l$F$$$k$H!"$=$Ne(B
=== e$B$r8F$P$Je(B
e$B$$$H$$$1$J$$$H$3$m!"8=:_$O8F$P$J$$$h$&$J<BAu$K$J$C$F$$$^$9!#$D$^$j!"e(B===
e$B$NDj5A$r??LLL$K8+D%$C$F$$$J$$$o$1$G$9!#e(B

e$B!!e(Bopt_plus
e$B$_$?$$$K!"!V:FDj5A!W$N%A%’%C%/%U%l!<%%o!<%/$rMxMQ$9$l$P$9$0e(B e$B$K2r7h=PMh$k$J!"$H;W$C$?$s$G$9$,!"!V:FDj5A!W%A%'%C%/%U%l!<%%o!<%/$O!V:Fe(B
e$BDj5A!W$r%A%’%C%/$9$k$s$G!"!VDj5A!W$O%A%’%C%/$G$-$J$$$H$$$&$3$H$K5$IU$-$^e(B
e$B$7$?!#!VDj5A!W$r%A%’%C%/$7$h$&$H$9$k$H!“4pDl%/%i%9$d%b%8%e!<%k$Ne(B
include
e$B$J$s$+$b%A%’%C%/$7$J$$$H$$$1$J$/$J$C$F$7$^$&$N$G!”$&$^$/$d$kJ}K!$,;W$$$De(B
e$B$-$^$;$s$G$7$?!J$$$:$l$O!"$3$&$$$&%U%l!<%`%o!<%/$bMQ0U$7$h$&$H;W$C$F$k$se(B
e$B$G$9$,e(B (*1)e$B!K!#e(B

e$B!!$H$$$&$3$H$G!"e(BFixnum#=== e$B$de(B Symbol#===
e$B$r:G=i$+$iDj5A$7$F$*$/$3$H$O5ve(B
e$B$5$l$k$G$7$g$&$+!#$=$&$9$k$H!"4{B8$N!V:FDj5A!W%A%’%C%/%U%l!<%`%o!<%/$r$=e(B
e$B$N$^$^MxMQ$9$k$3$H$,=PMh$^$9!#e(B

e$B!!6qBNE*$K$I$&Dj5A$9$k$+$H$$$&$H!"e(BFixnum#== e$B$de(B Symbol#==
e$B$HF1$8Dj5A$K$Je(B
e$B$j$^$9!#8=>u$Ne(B Object#=== e$B$,!"e(Bself.==
e$B$r8F$V$N$G!"e(BObject#=== e$B$J$I$re(B
e$B!J:F!KDj5A$7$J$$8B$j!"F0:n$OF1$8$K$J$j$^$9!#e(B

[email protected]!“e(BFixnum#=== e$B$J$I$rDj5A$7$F$7$^$&$N$G!“e(BInteger#===
e$B$J$I$rDj5A$7$Fe(B
e$B$b!”$=$NDj5A$,e(B Fixnum
e$B$G$O;H$o$l$J$$!”$H$$$&I{:nMQ$b=P$F$-$^$9!#e(B

e$B%G%U%)%k%H$Ne(B Object#=== e$B$,e(B rb_funcall()

e$B7PM3$G%a%=%C%I$r8F$V$N$G!"e(B

e$B$=$l$,>JN,[email protected]$1e(B Fixnum#===

e$B$J$s$+$,B.$/$J$k$+$b!#e(B

e$B!!$5$F!"$I$&$G$7$g$&!#%%V%8%’%/%H;X8~E$K$OH~$7$/$J$$$h$&$J5$$b$7$^$9e(B
e$B$,e(B…e$B!#e(B

1:
e$B$3$l$O!“C&:GE,2=$r$9$k$H$+$^$G<BAu$,?J$a$PI,[email protected]$J$!!”:n$i$J$$$He(B
e$B$J$!!"$H;W$C$F$$$?$s$G$9$,!"7k9=$
$*$,$+$j$K$J$j$=$&[email protected]$J!"$H$b;W$C$F$$$^$9!#e(B

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

In message “Re: [ruby-dev:38977] define === for some classes”
on Sat, 1 Aug 2009 22:16:42 +0900, SASADA Koichi [email protected]
writes:

|e$BDs0F!'e(B
|e$B!!$$$/$D$+$N%/%i%9!"Nc$($Pe(B Fixnum e$B$de(B Bignume$B!"e(BSymbol e$B$de(B String e$B$J$I$Ke(B ===
|e$B$rDj5A$7$F$b$$$$$G$7$g$&$+!#e(B
|
|e$BM}M3!'e(B
|e$B!!e(Bcase/when e$B$N:GE,2=$N$?$a$K!"8=:_!"2DG=$J$ie(B === e$B$r8F$S=P$5$J$$$h$&$K$7e(B
|e$B$F$$$^$9!#Nc$($P!“e(Bwhen e$B$G$R$C$+$1$k>r7o$,A4It%7%s%%k$d$i?tCM$d$i!”$N;~e(B
|e$B$G$9!#e(B

e$B%G%a%j%C%H$r4*0F$7$?>e$G$b!"$$$$$s$8$c$J$$$G$7$g$&$+!#1F6A$Ne(B
e$B$"$k%1!<%[email protected]$$$?$$!V$d$C$A$c$$$1$J$$$3$H!W$G$7$g$&$7!#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