Category:Smalltalk: Difference between revisions

Content added Content deleted
Line 327: Line 327:


===Message Sends===
===Message Sends===
<lang smalltalk>1000 factorial "send the 'factorial' message to the integer receiver"
<lang smalltalk>
1000 factorial "send the 'factorial' message to the integer receiver"


a factorial even "send the 'factorial' message to whatever "a" refers to, then send 'even' to whatever that returned"
a factorial even "send the 'factorial' message to whatever "a" refers to, then send 'even' to whatever that returned"
Line 348: Line 347:
b value "evaluate the block's code"
b value "evaluate the block's code"


b2 value:123 "evaluate another block's code, passing an argument"
b2 value:123 "evaluate another block's code, passing an argument"</lang>
</lang>


=== Other ===
=== Other ===