æ¼ç®åã追å ããæ©è½
Rubyãæ¹é ãã¦æ¼ç®åã追å ããæ©è½ãå®è£
ãã¦ã¿ã¾ããã
http://github.com/mas454/spcamp-ruby
operator 追å ãããæ¼ç®åå
ã§æ¼ç®åã追å ãããã¨ãã§ãã¾ãã
å®éã«ä½¿ãã¨ããããªæãã§ã
ãclass Fixnum def add(y) self + y end end operator add puts 10 add 20 #30ã表示ãããã
ããããã
operator à * operator ÷ / 10 + 10 à 2 10 + 10 ÷ 2
operator à *
ã®ããã«æ¼ç®åã追å ãããã¨ãã§ãã¾ãã
ãã®ããã«è¿½å ããå ´åãÃã®åªå
é ä½ã¯*ã¨åãã«ãªãã¾ãã