jross a �crit dans le message : 38e7e951.8384503@news.shreve.net... > > I was making the assumption that a case statement would compile to > evaluate every case until finding a match -- hence, not efficient. > Several years ago, I am sure this would have been the case (no pun > intended). However, now that I think about it, a compiler these days > should be intelligent enough to create an indexed jump table where all > (or most all) consecutive values are provided and create efficient > execution code. > As a point of information, when I was working on Ada/Ed (some years ago now), I had in my office a PhD thesis on "efficient code generation techniques for case statements". There was literally a dozen of techniques possible, depending on how the values were split over the whole range... Moral: NEVER make assumptions about the way code is generated, unless you REALLY know what's happening in the compiler (which in practice means, you are part of the compiler team!) -- --------------------------------------------------------- J-P. Rosen (Rosen.Adalog@wanadoo.fr) Visit Adalog's web site at http://pro.wanadoo.fr/adalog