From: markus jais Date: 2001-10-11T08:29:15+09:00 Subject: [ruby-talk:22405] list comprehensions alike Python ??? hello a few days ago, I bought the "Python 2.1 Bible" there (on page 51) is a cool feature described called "list comprehension" it works like this: with python code like this: l = [x * x for x in range(1, 11)] I get a list with squares of all numbers of 1-10 in ruby I could do this with the following code: a = Array.new (1..10).each { |elem| a[elem-1] = elem * elem } is there an even shorter way do to this in ruby?? regards markus -- Markus Jais http://www.mjais.de info@mjais.de The road goes ever on and on - Bilbo Baggins