From: "Jean-François Trân" Date: 2008-10-21T21:55:40+09:00 Subject: Re: Ruby way to take some action only once in a loop? 2008/10/21 Robert Klemme : >>> rows = ["row1", "row2"] >>> >>> rows.each do |row| >> if (first=true)..false and first > > Amazing! This is awesome, but I don't get all if I write : foo = (first=true)..false I've got a 'bad value for Range", but it works in a condition for if. first is a local variable the first time in the loop but not after, I don't understand why (the assignment first = true is not executed each time ?). very cute but puzzling. -- Jean-François. -- Les 50 ans du Lisp : http://www.lisp50.org http://twitter.com/underflow_