From: ts Date: 2001-10-21T02:21:08+09:00 Subject: [ruby-talk:22840] Re: array prob >>>>> "N" == Niko Schwarz writes: N> | a = a.sort { |a, b| ^ ^ | | N> thats the first problem. what you see is a workaround, but i dont get why N> a.sort! { bla... N> doesnt work. because you re-use `a' as a parameter for the block, change the name something like a.sort! { |x, y| ... } N> and here goes the second problem. for some weird reason which ive been N> trying to find the whole afternoon, a[0] is a fixnum in run 2. N> | a.map! { |elt| N> | faktor = (-a[0][s]) / tri[tri.length-1][s] N> | 0.upto(elt.length-1) { |i| N> | elt[i] += ( tri[tri.length-1][i] * faktor) N> | } N> | } a.map! replace the value with the result returned by the block, in your case this is the value returned by #upto Write it a.map! { |elt| faktor = (-a[0][s]) / tri[tri.length-1][s] 0.upto(elt.length-1) { |i| elt[i] += ( tri[tri.length-1][i] * faktor) } elt # return the value of elt } Guy Decoux