From: Eleanor McHugh Date: 2008-05-08T20:32:55+09:00 Subject: Re: initial stages of scripting On 8 May 2008, at 12:07, Eleanor McHugh wrote: > 1..20.inject(0) |sum, question| > # do stuff > sum += some_condition ? 1 : 0 > end which of course should be: 1..20.inject(0) |sum, question| #do stuff sum + (some_condition ? 1 : 0) end as the whole point of inject is that it does the assignment for you... I really must stick to this rule of no coding before my second cup of tea of the day ;) Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason