0276デフォルトの名無しさん
2015/02/18(水) 09:22:33.83ID:wdCl3CCW興味があって調べてみたのですが、GNU Smalltalk で定数同士演算(たとえば + 演算)で
メッセージ送信が省略されているのかが ideone.com の処理系では確認できませんでした。
「翻訳時」を「コンパイル時」、つまり「バイトコード変換時」と読み取ったのですが
バイトコードレベルで省略されているという話ではないのでしょうか?
メッセージ送信が省略されていることの確認の方法を教えていただければさいわいです。
UndefinedObject extend [
plusLit [^3+4]
plusNonLit [^3 + OrderedCollection new]
]
(UndefinedObject >> #plusLit) inspect printNl
"=>
[1] source code line number 2
[3] push 3
[5] push 4
send 1 args message #+
[7] return stack top "
(UndefinedObject >> #plusNonLit) inspect printNl
"=>
[1] source code line number 3
[3] push 3
[5] push Global Variable {Smalltalk.OrderedCollection}
[7] send 0 args message #new
[9] send 1 args message #+
[11] return stack top "
http://ideone.com/zWMggc