Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Your top-ten linux desktop apps


On 9/29/05, Andrew Bennetts <andrew-slug@xxxxxxxxxxxx> wrote:
> Python can be nicer than that:
>
>     integer_array = [1, -2, 3, -4, 5, -6, -7, 8, -9, 32727000]
>
>     for index, value in enumerate(integer_array):
>         print "integer [%d] = %d" % (index, value)

So can Smalltalk! :-)

integerArray :=  #(1 -2 3 -4 5 -6 -7 8 -9 32727000 9876543210).
integerArray doWithIndex: [:element :index|
	Transcript show: 'integer [', index printString, '] = ', element
printString; cr]

(can you other guys handle the big number I added at the end OK?)

Of course, beauty is in the eye of the beholder.

All the best,
      Bruce
--
Make the most of your skills - with OpenSkills
http://www.openskills.org/