From: "Hal E. Fulton" Date: 2003-01-24T13:24:59+09:00 Subject: Silly idea: map-like method produces array OK, I was thinking today about "stacked" assignment: x, y, z = 0 Fine and dandy, since Fixnums are immediate. But when there's a "real" object on the right, you get multiple references to the same one. Fine if that's what you want -- if not, oops. My silly solution: class Fixnum alias :mult :* def *(other) puts other if other.is_a? Numeric self.mult(other) else arr = [] self.times { arr << other.dup } arr end end end a, b, c, d, e = 5 * [] s1, s2, s3 = 3 * "hello" I also thought of another method that would take a block and thus the index could be used in generating values. The code is trivial. I won't cloud the issue by showing it to you. Comments? Hal