From: Josh Cheek Date: 2011-05-08T10:15:06+09:00 Subject: Re: Help with while condition OR condition --20cf307f3528ead5b204a2b97382 Content-Type: text/plain; charset=ISO-8859-1 On Sat, May 7, 2011 at 5:37 PM, Bill W. wrote: > > EXIT = "exit" #need constants since Ruby gets pissed at string literals > QUIT = "quit" #in a comparison > > It doesn't get pissed at string literals in comparison, its just that it was able to tell that the way you were comparing didn't make sense (because string literal is known at time you wrote it, not dynamically looked up, so the comparison is also known, and doesn't make sens). So it was warning you of the issue. It didn't complain when you stored then in vars/constants, because it doesn't know their value until runtime. They could hypothetically be false or nil, so it isn't conspicuously an error. e.g. if "some literal" # do something end # !> string literal in condition if "some literal" || "other" # do something end # !> string literal in condition --20cf307f3528ead5b204a2b97382--