Anonymous user
Category:Smalltalk: Difference between revisions
→A Word About Code Snippets in Rosetta
Line 653:
]</lang>
However, both are incompatible and not supported by most other dialects, which use the
<lang smalltalk>!Number methodsFor:'math'!
my_factorial
^ (self < 2) ifTrue:[1] ifFalse:[ self * (self-1) my_factorial]
! !</lang>
This chunk format is supported by all systems, but it is somewhat ugly to read and also needs exclamation marks to be doubled (which looks especially bad in string literals).
So in which dialect's fileOut format should the example be presented to be most convenient, readable, and to be repeatable in case someone wants to try Smalltalk?
|