#author("2017-04-25T00:37:58+09:00","","") * ''Smalltalk'' [#x1d05342] 参照[https://ja.wikipedia.org/wiki/Smalltalk] * 基本文法 [#k21cc076] - 宣言 #highlighter(perl,number){{ | tmp |"変数宣言" tmp := 1. "数値型の定義" tmp := 'moji'. "文字型の定義" tmp := true. "boolean型の定義" tmp := Date Today. "日付型の定義" tmp := Timestamp now. "時間型の定義" tmp := Array with:1 with:2 with:3."Array型の定義" tmp := List new add:1. "List 型の定義" tmp := nil. "UndefinedObject型の定義" ^tmp. "返却値" }} - 計算符号 |>|CENTER:100|c |>|計算符号|h |+|加算| |-|減算| |*|乗算| |**|累乗| |\|除算| |//|整数除算| |¥¥|余り| #author("2017-04-25T00:39:38+09:00","","") - 論理式 |>|CENTER:200|c |>|論理式|h |<|未満| |<=|以下| |>|超過| |>=|以上| |=|等しい| |~=|等しくない| |==|同一オブジェクト| |~~|同一オブジェクトではない| |&|AND| |||OR| - if文 #highlighter(perl,number){{ int > 0 "条件" ifTrue:[ n = 1 ] "真" ifFalse:[ n = 0 ]."偽" }} - for文 #highlighter(perl,number){{ | sum | sum := 0. 1 to: 10 do:[:each | sum := sum + each]. "1から10までループ" }}