From: William Djaja Tjokroaminata Date: 2002-09-27T07:37:56+09:00 Subject: Re: hash missing value Hi, I think it is already there. If you first declare the hash with files = Hash.new ("Untitled") then you will get "Untitled" instead of nil for any missing key. (But of course, then you cannot create and populate the hash at the same time :) Regards, Bill ============================================================================ MikkelFJ wrote: > Wouldn't it be useful with a missing value in hash tables so you avoid the > nil value and having to test for this? > files = { "item1" => "myfile.rb", "item2" => "mytestdata", missing_value => > "Untitled"} > window.caption = files[current_item] > (this is probably implemented or conflicts with something, this is what > happens to all my wouldn't it be nice....) > Mikkel