Category:Smalltalk: Difference between revisions

Line 422:
 
=== Other ===
<lang smalltalk>expr1 . expr2 "expressions (statements) within a method or block are separated by a fullstopfull stop."
 
'hello' print. 'world' print "expressions are separated by a periodfull stop; just like in english"
 
foo := bar "assignment; let foo refer to the object to which bar refers to
Line 430 ⟶ 432:
 
^ a + 1 "return; the value of 'a+1' as the value of the current method invocation."
 
'hello' print. 'world' print "expressions are separated by a period; just like in english"
 
|a b c| "local variables; introduces 'a', 'b' and 'c' in the current scope
Anonymous user