Anonymous user
Category:Smalltalk: Difference between revisions
→A Word About Code Snippets in Rosetta
Line 639:
ifTrue:[1]
ifFalse:[ self * (self-1) factorial ]</lang>
(here '<I>self</I>' is the Integer receiver object, and " ˆ " returns a value from the message send).
To get the factorial value, we'd evaluate in a workspace:<lang>10 factorial</lang>
|