From: Jim Freeze Date: 2003-06-02T04:06:13+09:00 Subject: Re: Advantages of Symbols over constants On Monday, 2 June 2003 at 0:13:21 +0900, John Johnson wrote: > One of my concerns with symbols is they spring into exsistence on their own, > ie. > > def foo(op) > case op > when :Bar > puts "Bar" > else > puts "a bug!" > end > end > > foo(:bar) > I see your point. If the code was supposed to be :bar instead of :Bar, then that would be a bug that would not have happened if an enum were used. I'm not saying you should never use enums, but I may not choose to use enums, even in this case. Instead, I would write a unit test that ensured correct code. I suppose deep down, this goes back to a static vs dynamic typing issue. No? -- Jim Freeze ---------- Every successful person has had failures but repeated failure is no guarantee of eventual success.