From: dblack@... Date: 2007-06-07T20:02:12+09:00 Subject: Re: === operator Hi -- On Thu, 7 Jun 2007, Bertram Scharpf wrote: > Am Donnerstag, 07. Jun 2007, 05:32:38 +0900 schrieb Robert Dober: >> On 6/6/07, dblack@wobblini.net wrote: >> >>> Yes; === is called on the when expression(s), with the case object as >>> argument. >> Well you are right of course, I said now because I did not understand >> what OP meant :( > > Some may say it's an unexpected behaviour. Others will find > themselves detecting it as a welcome surprise. This is Ruby > at its best. I always thought it was just the logical way to do the case statement. Since you're testing something about the case object, you may not know what it is or what its === method does: case x # what is x? when 1 ... when "yes" ... when C when nil ... end So I don't think it would make sense to have a case construct where === was called on x. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)