What are the key differences between OO in Smalltalk and Java?
Please note that I am a Java programmer trying to expand his horizons by exploring Smalltalk. Currently I
One Smalltalk concept that doesn't exist in Java but has become increasingly popular in recent years is blocks. Blocks are a form of anonymous functions that include the context they were defined in. Importantly, blocks are also objects. Smalltalk actually lacked any kind of built-in if
-statement or for
-loop or anything like that, but managed to create the same effect just with message-passing and blocks.
object isBig ifTrue: [self runIntoObject:object]
ifFalse: [self katamariBall absorbObject:object].
1 to: 10 do: [:number | number print]