Nil.to_s

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

trunke$B$Ge(Bnil.to_se$B$,e(B"nil"e$B$rJV$9$h$&$KJQ99$5$l$?$N$G!"$^$D$b$H$5$s$Ke(B
e$B!VK\5$$G$9$+e(B?e$B!W$HJ9$$$?$i$I$&$d$iK\5$$N$h$&$G$9!#e(B
e$BM}M3$O!Ve(Bnile$B$,6uJ8;[email protected]$+$i!W$H$$$&[email protected]$=$&$G$9$,!"e(B
[email protected]$C$?$i!"e(Bnil.to_ie$B$,e(B0e$B$K$J$k$N$OJQ$8$c$J$$$s$G$9$+!W$HJ9$/e(B
[email protected]$+$ie(Bnil.to_ie$B$OGQ;_$9$ke(B(NoMethodErrore$B$K$J$ke(B)e$B$D$b$j!We(B
e$B$H$$$&$3$H$G$7$?!#e(B

e$B$H$$$&$o$1$G!"$3$N$^$^[email protected]$H$=$&$$$&J}8~$K?J$s$G$$$-$=$&$G$9$,!"e(B
e$BK\Ev$K$$$$$s$G$9$+e(B? > e$B$_$J$5$se(B

e$B8D?ME*$K$O!“e(Bnile$B$OL5!&6u$rI=$9%*%V%8%’%/%[email protected]$H;W$C$F$$$k$N$G!“J8;ze(B
e$BNs$KJQ49$7$?$i6uJ8;zNs$K$J$k$H$$$&$N$O$=$s$J$K0cOB46$O$J$$$s$G$9e(B
e$B$,!”$I$&$G$7$g$&!#e(B
e$B$=$&9M$($k$H!”@0?t$KJQ49$9$k$He(B0e$B$H$$$&$N$b3d$H<+A3$J$s$8$c$J$$$+$He(B
e$B;W$$$^$9!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:29374] nil.to_s”
on Sep.01,2006 18:30:03, [email protected] wrote:
| trunke$B$Ge(Bnil.to_se$B$,e(B"nil"e$B$rJV$9$h$&$KJQ99$5$l$?$N$G!"$^$D$b$H$5$s$Ke(B
| e$B!VK\5$$G$9$+e(B?e$B!W$HJ9$$$?$i$I$&$d$iK\5$$N$h$&$G$9!#e(B

e$B$.$c$Ce(B!

| e$B8D?ME*$K$O!“e(Bnile$B$OL5!&6u$rI=$9%*%V%8%’%/%[email protected]$H;W$C$F$$$k$N$G!“J8;ze(B
| e$BNs$KJQ49$7$?$i6uJ8;zNs$K$J$k$H$$$&$N$O$=$s$J$K0cOB46$O$J$$$s$G$9e(B
| e$B$,!”$I$&$G$7$g$&!#e(B
| e$B$=$&9M$($k$H!”@0?t$KJQ49$9$k$He(B0e$B$H$$$&$N$b3d$H<+A3$J$s$8$c$J$$$+$He(B
| e$B;W$$$^$9!#e(B

e$BA4$/F146$G$9!#e(B

[email protected]}$7$F$_$^$7$g$&$+!#e(B

1.8.5
String(nil) #=> “”
Integer(nil) #=> 0
Float(nl) #=> TypeError
nil.to_s #=> “”
nil.to_i #=> 0
nil.to_f #=> 0.0

e$B8=;[email protected]$G$Ne(B1.9
String(nil) #=> “nil”
Integer(nil) #=> TypeError
Float(nl) #=> TypeError
nil.to_s #=> “nil”
nil.to_i #=> 0
nil.to_f #=> 0.0

e$BA0ED$5$s$N%a!<%k$+$i$N>-MhE8K>e(B
String(nil) #=> “nil”(?)
Integer(nil) #=> TypeError
Float(nl) #=> TypeError
nil.to_s #=> “nil”(?)
nil.to_i #=> NoMethodError
nil.to_f #=> NoMethodError(?)

[email protected]>!">-MhE8K>$,0lHVG<[email protected]$$$+$J$$!"$H$$$&$+!"$=$l$J$ie(Bnil.to_s
e$B$be(BNoMethodErrore$B$8$c$J$$$Ne(B?
e$B$H$+$$$&5$$,$7$^$9!#7y$G$9$1$I!#e(B
e$B$H$$$&$o$1$G!“e(B
String(nil) #=> TypeError
Integer(nil) #=> TypeError
Float(nl) #=> TypeError
nil.to_s #=> “”
nil.to_i #=> 0
nil.to_f #=> 0.0
e$B$H$$$&$”$?$j$r4uK>$7$^$9!#e(B

e$B$=$l$G$O!#e(B

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

U.Nakamura wrote:

[email protected]>!">-MhE8K>$,0lHVG<[email protected]$$$+$J$$!"$H$$$&$+!"$=$l$J$ie(Bnil.to_s
e$B$be(BNoMethodErrore$B$8$c$J$$$Ne(B? e$B$H$+$$$&5$$,$7$^$9!#7y$G$9$1$I!#e(B
e$B$H$$$&$o$1$G!“e(B
String(nil) #=> TypeError
Integer(nil) #=> TypeError
Float(nl) #=> TypeError
nil.to_s #=> “”
nil.to_i #=> 0
nil.to_f #=> 0.0
e$B$H$$$&$”$?$j$r4uK>$7$^$9!#e(B

e$B;d$b$3$l$,[email protected]$,$"$C$F!"[email protected]$H;W$$$^$9!#e(B

e$B$K$7!w$*$+$d$^$G$9!#e(B

At Fri, 1 Sep 2006 18:39:00 +0900,
U.Nakamura wrote:

In message “[ruby-dev:29374] nil.to_s”
on Sep.01,2006 18:30:03, [email protected] wrote:
| trunke$B$Ge(Bnil.to_se$B$,e(B"nil"e$B$rJV$9$h$&$KJQ99$5$l$?$N$G!"$^$D$b$H$5$s$Ke(B
| e$B!VK\5$$G$9$+e(B?e$B!W$HJ9$$$?$i$I$&$d$iK\5$$N$h$&$G$9!#e(B

e$B$.$c$Ce(B!

e$B$"$?$7$b$.$c$C!*e(B

e$B$H$$$&$"$?$j$r4uK>$7$^$9!#e(B

String(nil)e$B$He([email protected]<(E*$K;H$$J,$1$F$k;vNc$O$"$k$s$G$7$g$&$+!)e(B

String(nil) #=> “”
Integer(nil) #=> 0
Float(nl) #=> 0.0
nil.to_s #=> “”
nil.to_i #=> 0
nil.to_f #=> 0.0

e$B$NJ}$,0l4S$7$F$F$o$+$j$d$9$$$h$&$J5$$,$7$^$9!#e(B

e$B1J0fe([email protected]$BCNG=!%6e9)Bg$G$9!%e(B

From: Shugo M. [email protected]
Subject: [ruby-dev:29374] nil.to_s
Date: Fri, 1 Sep 2006 18:30:03 +0900
Message-ID: [email protected]

trunke$B$Ge(Bnil.to_se$B$,e(B"nil"e$B$rJV$9$h$&$KJQ99$5$l$?$N$G!"$^$D$b$H$5$s$Ke(B
e$B!VK\5$$G$9$+e(B?e$B!W$HJ9$$$?$i$I$&$d$iK\5$$N$h$&$G$9!#e(B
e$BM}M3$O!Ve(Bnile$B$,6uJ8;[email protected]$+$i!W$H$$$&[email protected]$=$&$G$9$,!"e(B
[email protected]$C$?$i!"e(Bnil.to_ie$B$,e(B0e$B$K$J$k$N$OJQ$8$c$J$$$s$G$9$+!W$HJ9$/e(B
[email protected]$+$ie(Bnil.to_ie$B$OGQ;_$9$ke(B(NoMethodErrore$B$K$J$ke(B)e$B$D$b$j!We(B
e$B$H$$$&$3$H$G$7$?!#e(B

e$B$H$$$&$o$1$G!"$3$N$^$^[email protected]$H$=$&$$$&J}8~$K?J$s$G$$$-$=$&$G$9$,!"e(B
e$BK\Ev$K$$$$$s$G$9$+e(B? > e$B$_$J$5$se(B

e$B7k9=!$%Q%K%C%/$,H/@8$7$=$&$G$9$M!%e(B(^_^;;
[email protected](B ([email protected]$,I,MW$+$I$&$+$rH=CG$7$F2s$k:n6H$r4^$`e(B)
e$B$r9M$($k$He(B
e$BF,$,DK$/$J$j$=$&$G$9!%e(B

e$B8D?ME*$K$O!"e(Bnile$B$OL5!&6u$rI=$9%*%V%8%’%/%[email protected]$H;W$C$F$$$k$N$G!“J8;ze(B
e$BNs$KJQ49$7$?$i6uJ8;zNs$K$J$k$H$$$&$N$O$=$s$J$K0cOB46$O$J$$$s$G$9e(B
e$B$,!”$I$&$G$7$g$&!#e(B

e$BF10U$7$^$9!%e(B
e$B$H$$$&$+!$e(Bnil.to_s e$B$,e(B “nil”
e$B$rJV$9J}$,$h$[$IJQ$H$$$&5$$,$7$^$9!%e(B

nil.inspect e$B$H$$$&$N$,$"$k$o$1$G$9$7!%!%!%e(B

e$B$=$&9M$($k$H!"@0?t$KJQ49$9$k$He(B0e$B$H$$$&$N$b3d$H<+A3$J$s$8$c$J$$$+$He(B
e$B;W$$$^$9!#e(B

nil.to_i -> 0 e$B$NJ}[email protected]@NO$,<e$/46$8$^$9$,!$e(B
e$B$=$&$$$&[email protected][email protected]$o$l$l$P==J,$KG<[email protected]$G$-$kHO0O$G$9!%e(B

e$B$+$:$R$3$G$9!#e(B

At Fri, 1 Sep 2006 18:42:51 +0900,
Shugo M. wrote:

e$B;d$b$3$l$,[email protected]$,$"$C$F!"[email protected]$H;W$$$^$9!#e(B

e$B;d$bF146$G$9!#e(B

e$B$5$9$,$K!"[email protected]!a;[email protected]!W$K$J$k$H:$$k$N$G!#!#!#e(B

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

In message “Re: [ruby-dev:29375] Re: nil.to_s”
on Fri, 1 Sep 2006 18:39:00 +0900, “U.Nakamura”
[email protected] writes:

|[email protected]}$7$F$_$^$7$g$&$+!#e(B
|
|1.8.5
| String(nil) #=> “”
| Integer(nil) #=> 0
| Float(nl) #=> TypeError
| nil.to_s #=> “”
| nil.to_i #=> 0
| nil.to_f #=> 0.0
|
|e$B8=;[email protected]$G$Ne(B1.9
| String(nil) #=> “nil”
| Integer(nil) #=> TypeError
| Float(nl) #=> TypeError
| nil.to_s #=> “nil”
| nil.to_i #=> 0
| nil.to_f #=> 0.0
|
|e$BA0ED$5$s$N%a!<%k$+$i$N>-MhE8K>e(B
| String(nil) #=> “nil”(?)
| Integer(nil) #=> TypeError
| Float(nl) #=> TypeError
| nil.to_s #=> “nil”(?)
| nil.to_i #=> NoMethodError
| nil.to_f #=> NoMethodError(?)
|
|[email protected]>!">-MhE8K>$,0lHVG<[email protected]$$$+$J$$!"$H$$$&$+!"$=$l$J$ie(Bnil.to_s
|e$B$be(BNoMethodErrore$B$8$c$J$$$Ne(B? e$B$H$+$$$&5$$,$7$^$9!#7y$G$9$1$I!#e(B

to_ie$B$de(Bto_fe$B$J$I$H0c$$e(Bto_se$B$Oe(BObjecte$B$KDj5A$5$l$F$$$^$9$+$i!"e(B
[email protected]$K$*$+$7$$$G$7$g$&!#$^$?!"e(Bto_se$B$O!V$=$N%*e(B
e$B%V%8%’%/%H$NJ8;zNsI=8=!W$G$9!#8=:_!“e(Bnil.to_se$B$Ge(B”“e$B$rJV$7$F$$$Fe(B
e$B:$$C$F$J$$$N$O!”$$$/$D$+$N6ILLe(B(putse$B$H$+e(Bprintfe$B$H$+e(B)e$B$Ge(Bnile$B$rFCe(B
e$BJL07$$$7$F$$$k$+$i$G$9!#$=$l$OH~$7$/$J$$$s$G$J$$$+$H!#e(B

e$B$=$NB>[email protected]$G$I$&G<[email protected]$+$J$$$N$+J9$+$;$F$/[email protected]$5$$$^$;!#e(B

|e$B$H$$$&$o$1$G!"e(B
| String(nil) #=> TypeError

Objecte$B$Ke(Bto_se$B$,$"$k$N$Ke(BString(nil)e$B$,<:GT$9$k$H$J$k$H!"e(B
String()e$B$,<:GT$9$k4p=`$H$$$&$N$,e(B(e$B$&$5$5$s$NF,$NCf$Ke(B)e$B$J$K$+$“e(B
e$B$k$s$G$9$+$M!#e(Bto_stre$B$,$”[email protected]$1JQ492DG=$H$+!)e(B

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

In message “Re: [ruby-dev:29376] Re: nil.to_s”
on Fri, 1 Sep 2006 18:42:51 +0900, Shugo M. [email protected]
writes:

|> e$B$H$$$&$o$1$G!“e(B
|> String(nil) #=> TypeError
|> Integer(nil) #=> TypeError
|> Float(nl) #=> TypeError
|> nil.to_s #=> “”
|> nil.to_i #=> 0
|> nil.to_f #=> 0.0
|> e$B$H$$$&$”$?$j$r4uK>$7$^$9!#e(B
|
|e$B;d$b$3$l$,[email protected]$,$"$C$F!"[email protected]$H;W$$$^$9!#e(B

e$B$&$5$5$s$X$N%U%)%m!<$G$b=q$-$^$7$?$,!">/$J$/$H$b;d$K$Oe(B(e$B$h$je(B
e$B9-$$HO0O$G8+$?;~$Ke(B)[email protected]$,$"$k$h$&$K$O8+$($^$;$s!#e(B
Object#to_se$B$,$"$k$N$Ke(BString(nil)e$B$,<:[email protected]$H$+!#e(B

e$BJXMx$+$I$&$+$O$^$?JL$NOC$G$9$,!#e(B

e$B$G$9$+$i!"$I$&[email protected]$,$"$k$N$+!"$I$&JXMx$J$N$+!"$b$&$A$g$C$He(B
[email protected]$7$F$$$-$?$$$G$9!#e(B

e$B$M$P$?$G$9!#e(B
e$B;d$b!"$3$N0F$K#10lI<!#e(B

e$BKX$I$N?M$O!"$3$N0F$,0lHV$$$$$H;W$C$F$$$k$N$G$O!)e(B

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

In message “Re: [ruby-dev:29381] Re: nil.to_s”
on Fri, 1 Sep 2006 20:33:38 +0900, “Nebata” [email protected]
writes:

|e$B;d$b!"$3$N0F$K#10lI<!#e(B
|
|e$BKX$I$N?M$O!"$3$N0F$,0lHV$$$$$H;W$C$F$$$k$N$G$O!)e(B

e$B$^!"$=$&$+$b$7$l$^$;$s$1$I$M!#$G$b!"!V$[$H$s$I$N?M$,$$$$$H;W$Ce(B
e$B$F$?!W$3$H$K=>$C$F$$$?$i!":#$Ne(BRubye$B$O$J$$$o$1$G!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:29380] Re: nil.to_s”
on Sep.01,2006 20:31:37, [email protected] wrote:
| |[email protected]>!">-MhE8K>$,0lHVG<[email protected]$$$+$J$$!"$H$$$&$+!"$=$l$J$ie(Bnil.to_s
| |e$B$be(BNoMethodErrore$B$8$c$J$$$Ne(B? e$B$H$+$$$&5$$,$7$^$9!#7y$G$9$1$I!#e(B
|
| to_ie$B$de(Bto_fe$B$J$I$H0c$$e(Bto_se$B$Oe(BObjecte$B$KDj5A$5$l$F$$$^$9$+$i!"e(B
| [email protected]$K$*$+$7$$$G$7$g$&!#$^$?!"e(Bto_se$B$O!V$=$N%*e(B
| e$B%V%8%’%/%H$NJ8;zNsI=8=!W$G$9!#8=:_!“e(Bnil.to_se$B$Ge(B”“e$B$rJV$7$F$$$Fe(B
| e$B:$$C$F$J$$$N$O!”$$$/$D$+$N6ILLe(B(putse$B$H$+e(Bprintfe$B$H$+e(B)e$B$Ge(Bnile$B$rFCe(B
| e$BJL07$$$7$F$$$k$+$i$G$9!#$=$l$OH~$7$/$J$$$s$G$J$$$+$H!#e(B
|
| e$B$=$NB>[email protected]$G$I$&G<[email protected]$+$J$$$N$+J9$+$;$F$/[email protected]$5$$$^$;!#e(B
|
| |e$B$H$$$&$o$1$G!“e(B
| | String(nil) #=> TypeError
|
| Objecte$B$Ke(Bto_se$B$,$”$k$N$Ke(BString(nil)e$B$,<:GT$9$k$H$J$k$H!"e(B
| String()e$B$,<:GT$9$k4p=`$H$$$&$N$,e(B(e$B$&$5$5$s$NF,$NCf$Ke(B)e$B$J$K$+$“e(B
| e$B$k$s$G$9$+$M!#e(Bto_stre$B$,$”[email protected]$1JQ492DG=$H$+!)e(B

e$B$$$:$l$b!“8+$?46$8e(B(e$B$=$l$O$D$^$j=q$$$?46$8$G$b$”$k$o$1$G$9$,e(B)
[email protected]$r5a$a$F$$$k$o$1$G$9$,!"[email protected]@[email protected]@$Ke(B
e$B$b$J$i$J$$$G$7$g$&$M$(!#e(B

e$B<B:]!"$"$"$$$&7A$G%j%9%H$r=q$/$H!"$=$l$J$j$K;?F1$9$k?M$bB?e(B

e$B$$$h$&$J$N$G!"F1$8$h$&$J!V46$8!W$r6&M-$9$k?M$bB?$$$h$&$G$Oe(B

e$B$"$j$^$9$,!#e(B

e$B$5$F!“e(Bto_se$B$,!V$=$N%%V%8%’%/%H$NJ8;zNsI=8=!W$G$"$k$N$O$=$&$Ge(B
e$B$9$,!"A0ED$5$s$b=q$+$l$?$h$&$K!"e(Bnile$B%
%V%8%’%/%H$NJ8;zNsI=8=$,e(B
e$B6uJ8;zNs$G$”$k$3$H$O<+A3$G$"$k$H;W$$$^$9!#e(B

e$B$^$?!“e(Bputse$B$de(Bprintfe$B$G$NFCJL07$$e(B(e$B8e<T$O<B$O$h$/$o$+$s$J$$$s$G$9e(B
e$B$,e(B)e$B$G$9$,!“e(Bnil.to_se$B$rJQ$($:$K$=$NFCJL07$$$NJ}$r$d$a$k!”$H$$$&e(B
e$BA*Br;h$O$J$$$N$G$7$g$&$+e(B?
nil.to_se$B$rJQ$($F$b!“e(Bputse$B$J$I$G$NFCJL07$$$r$d$a$F$b!”$$$:$l$Ke(B
e$B$;$hHs8_49$,H/@8$9$k$o$1$G$9$,!”;d$H$7$F$OFCDj$N%a%=%C%I$KHse(B
e$B8_49ItJ,$,JD$89~$a$i$l$kJ}$,$h$5$=$&$K46$8$^$9!#e(B

e$B$"$H!“e(BString()e$B$,<:GT$9$k4p=$G$9$,!"<B$O$<$s$<$s4p=$O$”$j$^e(B
e$B$;$s$G$7$?!#<e$$!#e(B
String()e$B$He(BInteger()e$B!&e(BFloat()e$B$H$OHf3S$G$-$k$[$IF1$8;WA[$K$O$Je(B
e$B$$!"$H$$$&$3$H$K$J$k$N$G$9$+$M!#e(B

e$B$=$l$G$O!#e(B

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

Yukihiro M. wrote:

to_ie$B$de(Bto_fe$B$J$I$H0c$$e(Bto_se$B$Oe(BObjecte$B$KDj5A$5$l$F$$$^$9$+$i!"e(B
[email protected]$K$*$+$7$$$G$7$g$&!#$^$?!"e(Bto_se$B$O!V$=$N%*e(B
e$B%V%8%’%/%H$NJ8;zNsI=8=!W$G$9!#8=:_!“e(Bnil.to_se$B$Ge(B”“e$B$rJV$7$F$$$Fe(B
e$B:$$C$F$J$$$N$O!”$$$/$D$+$N6ILLe(B(putse$B$H$+e(Bprintfe$B$H$+e(B)e$B$Ge(Bnile$B$rFCe(B
e$BJL07$$$7$F$$$k$+$i$G$9!#$=$l$OH~$7$/$J$$$s$G$J$$$+$H!#e(B

e$B$"$"!"$J$k$[$I!"e(Bputse$B$J$I$r5$$K$5$l$F$?$s$G$9$M!#e(B
e$B$G$b$&$5$5$s$b=q$+$l$F$$$^$9$,!"e(Bputse$B$NJ}$rJQ$($kJ}$,$$$$$h$&$Ke(B
e$B;W$$$^$9!#e(B

e$B$=$A$i$NJ}$,[email protected]$N>e$G$b1F6A$,>/$J$$$N$G$O$J$$$+$H?dB,$9$ke(B

e$B$N$G$9$,!"$I$&$G$7$g$&!#e(B

e$B7k6I!"e(Bnile$B$NJ8;zNsI=8=$H$7$F6uJ8;zNs$,<+A3$+$I$&$+$H$$$&$N$,!“e(B
[email protected][email protected]$H;W$&$N$G!”$^$D$b$H$5$s$,[email protected]$H;W$o$l$kM}M3$re(B
e$B$b$&>/[email protected]@[email protected]$1$l$P$H;W$$$^$9!#e(B

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

e$B$^$:!"[email protected]$r4JC1$K$9$k$?$a$K!"e(BString(nil)e$B$NOC$He(Bnil.to_se$B$NOC$OJ,$1e(B
e$B$F9M$($^$;$s$+e(B?
e$B$3$3$G$O!"e(BString(nil)e$B$K$D$$$F9M$($?$$$H;W$$$^$9!#e(B

Yukihiro M. wrote:

e$B$&$5$5$s$X$N%U%)%m!<$G$b=q$-$^$7$?$,!">/$J$/$H$b;d$K$Oe(B(e$B$h$je(B
e$B9-$$HO0O$G8+$?;~$Ke(B)[email protected]$,$"$k$h$&$K$O8+$($^$;$s!#e(B
Object#to_se$B$,$"$k$N$Ke(BString(nil)e$B$,<:[email protected]$H$+!#e(B

[email protected]$,$"$k!W$H$$$&I=8=$O$h$/$J$+$C$?$+$b$7$l$^$;$s!#e(B
[email protected]$,$"$k$h$&$K8+$($k!W$H$$$&$H$3$m$G$7$g$&$+!#e(B

[email protected][email protected]7W$9$kB&[email protected]$,$J$$$h$&$K8+$($k$+$b$7$l$^$;$se(B
e$B$,!"[email protected]$r;H$C$F%W%m%0%i%`$rFI$
=q$-$9$kN)>l$+$i8+$k$H!"$o$je(B
[email protected]$,$"$k$h$&$K8+$($k$h$&$J5$$,$7$^$9!#e(B
e$B$?$V$s!“e(Bto_ie$B$,JQ49$,4|BT$5$l$k$+$I$&$+HyL/$J6ILL$G!”$H$j$"$($:JXe(B
e$BMx$=$&$JCM$KJQ49$7$F$7$^$&$N$KBP$7$F!"e(BIntegere$B$,$=$&$$$&6ILL$G$O%(e(B
e$B%i!<$r=P$9$N$G!"e(BIntegere$B0J30$NB>$N7?$X$NJQ49$G$bF1MM$N5sF0$r4|BT$7e(B
e$B$F$7$^$&$N$G$O$J$$$+$H;W$$$^$9!#e(B

e$BJXMx$+$I$&$+$O$^$?JL$NOC$G$9$,!#e(B

e$B$G$9$+$i!"$I$&[email protected]$,$"$k$N$+!"$I$&JXMx$J$N$+!"$b$&$A$g$C$He(B
[email protected]$7$F$$$-$?$$$G$9!#e(B

e$BJXMx$J$N$O!";H$&;~$K$I$A$i$rA*$V$+$N4p=`$,[email protected]$He(B
e$B;W$$$^$9!#$J$k$Y$/%(%i!<$K$;$:$K2?$i$+$NCM$KJQ49$7$F$[$7$$;~$Oe(B
to_ie$B7O$r;H$C$F!"HyL/$J>l9g$O%(%i!<$K$7$F$[$7$$;~$Oe(BInteger()e$B7O$re(B
e$B;H$($P$$$$$N$G!#e(B

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

In message “Re: [ruby-dev:29386] String(nil)”
on Fri, 1 Sep 2006 23:15:01 +0900, Shugo M. [email protected]
writes:

|e$B$^$:!"[email protected]$r4JC1$K$9$k$?$a$K!"e(BString(nil)e$B$NOC$He(Bnil.to_se$B$NOC$OJ,$1e(B
|e$B$F9M$($^$;$s$+e(B?
|e$B$3$3$G$O!"e(BString(nil)e$B$K$D$$$F9M$($?$$$H;W$$$^$9!#e(B

e$B$^$:$O4JC1$JJ}$+$i!#e(B

|Yukihiro M. wrote:
|> |> e$B$H$$$&$o$1$G!"e(B
|> |> String(nil) #=> TypeError
|> |> Integer(nil) #=> TypeError
|> |> Float(nl) #=> TypeError
|> |> nil.to_s #=> “”
|> |> nil.to_i #=> 0
|> |> nil.to_f #=> 0.0

|> |e$B;d$b$3$l$,[email protected]$,$"$C$F!"[email protected]$H;W$$$^$9!#e(B

|[email protected]$,$"$k!W$H$$$&I=8=$O$h$/$J$+$C$?$+$b$7$l$^$;$s!#e(B
|[email protected]$,$"$k$h$&$K8+$($k!W$H$$$&$H$3$m$G$7$g$&$+!#e(B

e$B$^$"!"M}2r$G$-$J$$$o$1$G$O$J$$$G$9!#e(B

|[email protected][email protected]7W$9$kB&[email protected]$,$J$$$h$&$K8+$($k$+$b$7$l$^$;$se(B
|e$B$,!"[email protected]$r;H$C$F%W%m%0%i%`$rFI$
=q$-$9$kN)>l$+$i8+$k$H!"$o$je(B
|[email protected]$,$"$k$h$&$K8+$($k$h$&$J5$$,$7$^$9!#e(B
|e$B$?$V$s!“e(Bto_ie$B$,JQ49$,4|BT$5$l$k$+$I$&$+HyL/$J6ILL$G!”$H$j$"$($:JXe(B
|e$BMx$=$&$JCM$KJQ49$7$F$7$^$&$N$KBP$7$F!"e(BIntegere$B$,$=$&$$$&6ILL$G$O%(e(B
|e$B%i!<$r=P$9$N$G!"e(BIntegere$B0J30$NB>$N7?$X$NJQ49$G$bF1MM$N5sF0$r4|BT$7e(B
|e$B$F$7$^$&$N$G$O$J$$$+$H;W$$$^$9!#e(B

Integer()e$B$He(BFloat()e$B$OAPBP$G$9$+$i$=$l$O$=$l$GNI$$$H;W$$$^$9!#e(B
e$B$G!"e(BString()e$B$K$b$=$l$r4|BT$9$k$H$9$k$H!“J8;zNs$K$H$C$F!VJQ49e(B
e$B$,4|BT$5$l$k$+$I$&$+HyL/$J6ILL!W$H$O$I$N$h$&$J6ILL$+$^$:Dj5Ae(B
e$B$9$kI,MW$,$”$k$H;W$$$^$9!#e(B

e$B;d$O!“e(B(nile$B$b4^$a$F$9$Y$F$Ne(BObjecte$B$,e(Bto_se$B$r;}$A!”$J$s$i$+$NJ8;ze(B
e$BNsI=8=$r;}$D$N$Ge(B)e$B!VHyL/$J6ILL!W$OB8:_$7$J$$$H9M$($F$$$^$9!#e(B
e$B$H$$$&$3$H$O!";d$K$H$C$F$Oe(B

String(nil) #=> TypeError

e$B$O!V$"$j$($J$$!W46$8$J$s$G$9$,!">e5-0F$K;[email protected]$5$l$?J}!9$O$I$Ne(B
e$B$h$&$K46$8$F$*$i$l$k$N$G$7$g$&$+!#e(B

|e$BJXMx$J$N$O!";H$&;~$K$I$A$i$rA*$V$+$N4p=`$,[email protected]$He(B
|e$B;W$$$^$9!#$J$k$Y$/%(%i!<$K$;$:$K2?$i$+$NCM$KJQ49$7$F$[$7$$;~$Oe(B
|to_ie$B7O$r;H$C$F!"HyL/$J>l9g$O%(%i!<$K$7$F$[$7$$;~$Oe(BInteger()e$B7O$re(B
|e$B;H$($P$$$$$N$G!#e(B

e$B$^$"!"$=$&$G$7$g$&$M!#$G!"e(BString()e$B$K$O!VHyL/$J>l9g$,B8:_$7$Je(B
e$B$$!W$H$$$&$N$,;d$N9M$($G$9!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

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

[email protected];[email protected]!W$O5W$7$V$j$J$N$G!"@5D>!"4n$s$G$^$9!#e(B

In message “Re: [ruby-dev:29387] Re: nil.to_s”
on Fri, 1 Sep 2006 23:35:57 +0900, Shugo M. [email protected]
writes:

|e$B$"$"!"$J$k$[$I!"e(Bputse$B$J$I$r5$$K$5$l$F$?$s$G$9$M!#e(B
|e$B$G$b$&$5$5$s$b=q$+$l$F$$$^$9$,!"e(Bputse$B$NJ}$rJQ$($kJ}$,$$$$$h$&$Ke(B
|e$B;W$$$^$9!#e(B

e$B!Ve(Bputse$B$NJ}$rJQ$($k!W$H$$$&$N$O!"$I$&$$$&Iw$KJQ$($k$3$H$rA[Dje(B
e$B$7$F$$$k$s$G$7$g$&$M!#e(Bnil.to_se$B$re(B"“e$B$N$^$^$K$9$k$J$i!”!VJQ$($Je(B
e$B$$!W$N$,0lHVNI$$$H;W$&$N$G$9$,!#e(B

|e$B7k6I!"e(Bnile$B$NJ8;zNsI=8=$H$7$F6uJ8;zNs$,<+A3$+$I$&$+$H$$$&$N$,!“e(B
|[email protected][email protected]$H;W$&$N$G!”$^$D$b$H$5$s$,[email protected]$H;W$o$l$kM}M3$re(B
|e$B$b$&>/[email protected]@[email protected]$1$l$P$H;W$$$^$9!#e(B

nile$B$H$$$&$N$O!V$J$s$G$b$J$$!W$3$H$r0UL#$9$k%%V%8%’%/%H$G!"e(B
e$B?tCM$G$b?tCME
$J%%V%8%’%/%H$G$b$"$j$^$;$s$+$i!“e(B(to_ie$B$K$h$ke(B)
e$B?tCM$X$NJQ49BP>]$G$”$k$H$$$&$N$OIT<[email protected]$H;W$$$^$9!#F1e(B
e$BMM$Ke(Bnil.to_se$B$O!V$=$N%
%V%8%’%/%H$,$I$s$J$b$N$G$"$k$+!W$,$O$Ce(B
e$B$-$jJ,$+$kJ8;zNs$G$"$k$Y$-$G!"$=$l$O6uJ8;zNs$G$O$J$/!“e(B"nil”
e$B$H$$$&I=8=$G$O$J$$$+$H46$8$^$7$?!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

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

Hidetoshi NAGAI wrote:

e$B7k9=!$%Q%K%C%/$,H/@8$7$=$&$G$9$M!%e(B(^_^;;
[email protected](B ([email protected]$,I,MW$+$I$&$+$rH=CG$7$F2s$k:n6H$r4^$`e(B) e$B$r9M$($k$He(B
e$BF,$,DK$/$J$j$=$&$G$9!%e(B

e$B%(%i!<$K$J$i$J$$$H$3$m$,G:$^$7$$$G$9$M!#e(B
e$B%f%K%C%H%F%9%H$J$I$,$"$l$P!"e(Bto_se$B$re(Bundefe$B$7$?$j$7$F%A%’%C%/$G$-$=$&e(B
e$B$G$9$,!#e(B

e$B8D?ME*$K$O!"e(Bnile$B$OL5!&6u$rI=$9%*%V%8%’%/%[email protected]$H;W$C$F$$$k$N$G!“J8;ze(B
e$BNs$KJQ49$7$?$i6uJ8;zNs$K$J$k$H$$$&$N$O$=$s$J$K0cOB46$O$J$$$s$G$9e(B
e$B$,!”$I$&$G$7$g$&!#e(B

e$BF10U$7$^$9!%e(B
e$B$H$$$&$+!$e(Bnil.to_s e$B$,e(B “nil” e$B$rJV$9J}$,$h$[$IJQ$H$$$&5$$,$7$^$9!%e(B

nil.inspect e$B$H$$$&$N$,$"$k$o$1$G$9$7!%!%!%e(B

e$B8D?ME*$K$Oe(Bnil.to_se$B$,e(B"nil"e$B$J$N$OJQ$H$^$G$O;W$$$^$;$s!#e(B
e$B$,!“e(B”"e$B$K$J$k$N$b<+A3$K8+$($k$N$G!“[email protected]$r5>@7$K$7$F$^$GJQ$($J$/e(B
e$B$F$b$h$$$N$G$O!”$H$$$&$N$,;d$N0U8+$G$9!#e(B

e$B$=$&9M$($k$H!"@0?t$KJQ49$9$k$He(B0e$B$H$$$&$N$b3d$H<+A3$J$s$8$c$J$$$+$He(B
e$B;W$$$^$9!#e(B

nil.to_i -> 0 e$B$NJ}[email protected]@NO$,<e$/46$8$^$9$,!$e(B
e$B$=$&$$$&[email protected][email protected]$o$l$l$P==J,$KG<[email protected]$G$-$kHO0O$G$9!%e(B

http://ja.wikipedia.org/wiki/0

e$B$H$+$rFI$`$H<+A3$K46$8$k$N$G$9$,!"$3$N$"$?$j$OLg304A$J$N$G>$7$$e(B
e$BJ}$K$*$^$+$;$7$^$9!#e(B

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

Yukihiro M. wrote:

e$B;d$O!“e(B(nile$B$b4^$a$F$9$Y$F$Ne(BObjecte$B$,e(Bto_se$B$r;}$A!”$J$s$i$+$NJ8;ze(B
e$BNsI=8=$r;}$D$N$Ge(B)e$B!VHyL/$J6ILL!W$OB8:_$7$J$$$H9M$($F$$$^$9!#e(B
e$B$H$$$&$3$H$O!";d$K$H$C$F$Oe(B

String(nil) #=> TypeError

e$B$O!V$"$j$($J$$!W46$8$J$s$G$9$,!">e5-0F$K;[email protected]$5$l$?J}!9$O$I$Ne(B
e$B$h$&$K46$8$F$*$i$l$k$N$G$7$g$&$+!#e(B

e$B$=$&[email protected]$o$l$l$P$=$s$J5$$b$9$k$N$G$9$,!"$"$^$j!V$"$j$($J$$!W46$8$,e(B
e$B$7$J$+$C$?$N$O!"e(Bnile$B$NFC<[email protected]$N$;$$$G$O$J$$$+$H;W$$$^$9!#e(B

e$B$H$O$$$(!"<B$O$3$3$K$O$=$s$J$K6/[email protected]$o$j$O$J$$$N$G!"8D?ME*$K$Oe(B

String(nil) #=> “”
Integer(nil) #=> TypeError
Float(nil) #=> TypeError
nil.to_s #=> “”
nil.to_i #=> 0
nil.to_f #=> 0.0

e$B$G$b$$$$$H;W$$$^$9!#e(B

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

In message “Re: [ruby-dev:29391] Re: String(nil)”
on Fri, 1 Sep 2006 23:56:37 +0900, Shugo M. [email protected]
writes:

|>> String(nil) #=> TypeError
|>
|> e$B$O!V$"$j$($J$$!W46$8$J$s$G$9$,!">e5-0F$K;[email protected]$5$l$?J}!9$O$I$Ne(B
|> e$B$h$&$K46$8$F$*$i$l$k$N$G$7$g$&$+!#e(B
|
|e$B$=$&[email protected]$o$l$l$P$=$s$J5$$b$9$k$N$G$9$,!"$"$^$j!V$"$j$($J$$!W46$8$,e(B
|e$B$7$J$+$C$?$N$O!"e(Bnile$B$NFC<[email protected]$N$;$$$G$O$J$$$+$H;W$$$^$9!#e(B

e$B$U$&$`!#e(B

|e$B$H$O$$$(!"<B$O$3$3$K$O$=$s$J$K6/[email protected]$o$j$O$J$$$N$G!"8D?ME*$K$Oe(B
|
|String(nil) #=> “”
|Integer(nil) #=> TypeError
|Float(nil) #=> TypeError
|nil.to_s #=> “”
|nil.to_i #=> 0
|nil.to_f #=> 0.0
|
|e$B$G$b$$$$$H;W$$$^$9!#e(B

e$B$H$J$k$H!“e(BString()e$B$K$D$$$F$O!”>/$J$/$H$b;d$HA0ED$/$s$N4V$G$Oe(B
e$B$"$kDxEY$N9g0U$,$G$-$?!"$H$$$&$3$H$G!#e(B

e$B8e$O!“e(Bnil.to_s, nil.to_i,
nil.to_fe$B$,$I$&$”$k$Y$-$+!"$G$9$h$M!#e(B
e$BCfB<0F$O>e5-$NDL$j$H$7$F!"$^$D$b$H0F$Oe(B

nil.to_s #=> “nil”
nil.to_i #=> NoMethodError
nil.to_f #=> NoMethodError

e$B$G$9!#M}M3$K$D$$$F$O$9$G$K=R$Y$^$7$?!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

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

On 2006/09/01, at 18:51, NISHI Takao wrote:

e$B$NJ}$,0l4S$7$F$F$o$+$j$d$9$$$h$&$J5$$,$7$^$9!#e(B

e$B$o$?$7$O$3$A$i$K;[email protected]$G$9!#e(B

to_s, to_i, to_fe$B$Oe(BString, Integer,
Floate$B$Ke(B(e$B$J$s$H$+e(B)e$BJQ49$9$k%a%=%C%I$H$$$&e(B
e$B0u>]$,$"$C$F!“e(Bnile$B$,e(B”", 0,
0.0e$B$KJQ49$5$l$F$bJQ$8$c$J$$5$$,$7$^$9!#e(B

e$B$=$&[email protected][email protected]$NJ}$,5$$K$J$k$H$$$&$N$,@5D>$J$H$3$m!E!#e(B

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

Yukihiro M. wrote:

[email protected];[email protected]!W$O5W$7$V$j$J$N$G!"@5D>!"4n$s$G$^$9!#e(B

e$B$H$/$K;d$O$[$s$H$K5W$7$V$j$G$9$M!#e(B

|e$B$"$"!"$J$k$[$I!"e(Bputse$B$J$I$r5$$K$5$l$F$?$s$G$9$M!#e(B
|e$B$G$b$&$5$5$s$b=q$+$l$F$$$^$9$,!"e(Bputse$B$NJ}$rJQ$($kJ}$,$$$$$h$&$Ke(B
|e$B;W$$$^$9!#e(B

e$B!Ve(Bputse$B$NJ}$rJQ$($k!W$H$$$&$N$O!"$I$&$$$&Iw$KJQ$($k$3$H$rA[Dje(B
e$B$7$F$$$k$s$G$7$g$&$M!#e(Bnil.to_se$B$re(B"“e$B$N$^$^$K$9$k$J$i!”!VJQ$($Je(B
e$B$$!W$N$,0lHVNI$$$H;W$&$N$G$9$,!#e(B

[email protected]$N$_$r9M$($k$J$i$P!"e(B

puts nil #=> e$B2~9T$N$_=PNOe(B

e$B$H$9$kJ}$,$h$$$h$&$K;W$$$^$9!#e(B
e$B$b$A$m$s!“e(Bnil.to_se$B$,e(B”“e$B$K$J$k$3$H$He(B"nil"e$B$K$J$k$3$H$,F1DxEY$K<+A3e(B
e$B$G$”$k$J$i$P!"$H$$$&$3$H$G$9$,!#e(B

|e$B7k6I!"e(Bnile$B$NJ8;zNsI=8=$H$7$F6uJ8;zNs$,<+A3$+$I$&$+$H$$$&$N$,!“e(B
|[email protected][email protected]$H;W$&$N$G!”$^$D$b$H$5$s$,[email protected]$H;W$o$l$kM}M3$re(B
|e$B$b$&>/[email protected]@[email protected]$1$l$P$H;W$$$^$9!#e(B

nile$B$H$$$&$N$O!V$J$s$G$b$J$$!W$3$H$r0UL#$9$k%%V%8%’%/%H$G!"e(B
e$B?tCM$G$b?tCME
$J%*%V%8%’%/%H$G$b$"$j$^$;$s$+$i!“e(B(to_ie$B$K$h$ke(B)
e$B?tCM$X$NJQ49BP>]$G$”$k$H$$$&$N$OIT<[email protected]$H;W$$$^$9!#F1e(B

Stringe$B%%V%8%’%/%H$b$=$l<+BN$O$?$s$J$kJ8;z$NJB$S$r0UL#$9$k$b$N$G!"e(B
e$B?tCM$G$b?tCME
$G$b$J$$$h$&$K;W$$$^$9$,!"$I$&$G$7$g$&$+!#e(B
e$B$"$k%%V%8%’%/%H$re(Bto_ie$B$K$h$k?tCM$X$NJQ49BP>]$H$9$k$+$I$&$+$O!"$=e(B
e$B$N%
%V%8%’%/%H$,?tCM$"$k$$$O?tCME*$G$"$k$+$I$&$+$h$j$b!"?tCM$X$Ne(B
e$BJQ49$K0UL#$r8+$$=P$;$k$+$I$&$+$GH=CG$9$kJ}$,$h$$$N$G$O$J$$$+$H;We(B
e$B$$$^$9!#e(B

[email protected]$He(B0e$B$H$O;W$($J$$$+$b$7$l$^$;$s$,!"!V$J$s$K$b$J$$!We(B
e$B$H9M$($k$H!"?tCM$KFI$_JQ$($?>l9g!"$^$5$Ke(B0e$B$G$O$J$$$G$7$g$&$+!#e(B

e$BMM$Ke(Bnil.to_se$B$O!V$=$N%*%V%8%’%/%H$,$I$s$J$b$N$G$"$k$+!W$,$O$Ce(B
e$B$-$jJ,$+$kJ8;zNs$G$"$k$Y$-$G!"$=$l$O6uJ8;zNs$G$O$J$/!“e(B"nil”
e$B$H$$$&I=8=$G$O$J$$$+$H46$8$^$7$?!#e(B

[1, 2,
3].to_se$B$Oe(B"123"e$B$K$J$j$^$9$,!"!V$=$N%%V%8%’%/%H$,$I$s$J$b$Ne(B
e$B$G$"$k$+!W$Oe(B"123"e$B$+$i$OFI$_<h$l$^$;$s$h$M!#e(B
e$BB>$N%
%V%8%’%/%H$G$be(Bto_se$B$N7k2L$+$i$O!V$=$N%*%V%8%’%/%H$,$I$s$J$b$Ne(B
e$B$G$"$k$+!W$O$O$C$-$j$7$J$$%1!<%9$,$"$k$N$G!"e([email protected]$1$rJQ$($kM}M3$He(B
e$B$7$F$O<e$$$h$&$K;W$$$^$9!#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