Anonymous user
Category:Smalltalk: Difference between revisions
→Other
(→Other) |
|||
Line 413:
=== Other ===
<lang smalltalk>expr1 . expr2 "statements within a method or block are separated by a fullstop."
foo := bar "assignment; let foo refer to the object to which bar refers to
(at that particular point in time)"
^ a + 1 "return; the value of
'hello' print. 'world' print "statements are separated by a period; just like in english"
|a b c| "local variables; introduces 'a', 'b' and 'c' in the current scope
(let-like local bindings)"
r msg1; msg2
Syntactic sugar for (t := r) msg1. t msg2
but an expression, not a statement (with an anonymous variable 't')"</lang>
=== Class Definition ===
|