小田 利通
2021-05-13 01:55:00 UTC
$B%-!<%o!<%I0z?t$K(B $B5?;wJQ?t(B self $B$J$I$r;H$&$H!"%(%i!<$K$J$j$^$;$s!#(B
def f(self:10)
p self
end
f() #=> main
self $B$KBeF~$5$l$J$$$@$1$G$9$,!"%-!<%o!<%I$G$J$$2>0z?t$K(B self $B$r(B
$B;H$C$?>l9g$HF1$8$/%(%i!<$H$J$C$FM_$7$$$H;W$$$^$9!#(B
def g(self)
p self
end #=> syntax error
$ ruby --version #=> ruby 2.7.1p83
https://docs.ruby-lang.org/ja/latest/doc/spec=2fvariables.html#pseudo
def f(self:10)
p self
end
f() #=> main
self $B$KBeF~$5$l$J$$$@$1$G$9$,!"%-!<%o!<%I$G$J$$2>0z?t$K(B self $B$r(B
$B;H$C$?>l9g$HF1$8$/%(%i!<$H$J$C$FM_$7$$$H;W$$$^$9!#(B
def g(self)
p self
end #=> syntax error
$ ruby --version #=> ruby 2.7.1p83
https://docs.ruby-lang.org/ja/latest/doc/spec=2fvariables.html#pseudo
$B5?;wJQ?t$NCM$rJQ99$9$k$3$H$O$G$-$^$;$s!#5<;wJQ?t$XBeF~$9$k$HJ8K!%(%i!<$K$J$j$^$9!#(B
T.Oda