Category:Smalltalk: Difference between revisions

Content added Content deleted
Line 658: Line 658:
^ (self < 2) ifTrue:[1] ifFalse:[ self * (self-1) my_factorial]
^ (self < 2) ifTrue:[1] ifFalse:[ self * (self-1) my_factorial]
! !</lang>
! !</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).
This chunk format is supported by all systems, but it is somewhat ugly to read and also needs exclamation marks to be doubled in the code (which looks especially bad in string literals).

Inside the Smalltalk IDE, you will never see any of the above, as this is only used as interchange format.


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?
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?