Loops/With multiple ranges: Difference between revisions

(→‎{{header|Smalltalk}}: an alternative (better ?))
Line 1,706:
 
=={{header|Smalltalk}}==
Ranges (called ''Interval'' in Smalltalk) are collections, which - like all collections - can be concatenated with the <tt>,</tt> (comma) message. Intervals are created by sending a <tt>to:</tt> or <tt>to:by:</tt> message to a magnitude-like thingy (i.e. other than numbers are possible):
<lang smalltalk>prod := 1.
sum := 0.
Anonymous user