On May 3, 9:14 pm, djolley <[email protected]> wrote: > > Now, I want to clarify the above statement. My recollection of the > cases in which I have previously gotten into trouble didn't involve a > hash; but, rather, I was doing something like, "if foo" and the > trouble arose when the foo variable had not been defined. So, I > realize that is not the same thing as a key being absent from a hash. > Perhaps I can get away with it in the case of a hash. If so, I'm just > going to have to expand my understanding of what constitutes false in > Ruby to include the absence of a key from a hash. So, out of > curiosity, is it your understanding that, in Ruby, false includes the > absence of a key from a hash?
it's not so much what constitutes false as what [:foo] returns if the hash doesn't have a value for that key (and by default that's nil) Fred > > Thanks. > > ... doug --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

