From: nobu.nokada@... Date: 2001-12-24T04:39:01+09:00 Subject: [ruby-talk:29377] Re: a better way? At Mon, 24 Dec 2001 03:57:41 +0900, Ron Jeffries wrote: > These are way cool. I gather the 1.7.2 feature is new? I think I'm in > 1.6 and it doesn't work there. Yes, it works on only recent one. ChageLog: revision 1.58 date: 2001/12/10 07:18:12; author: matz; state: Exp; lines: +33 -12 * hash.c (rb_hash_initialize): now accepts a block to calculate the default value. [new] * hash.c (rb_hash_aref): call "default" method to get the value corrensponding to the non existing key. * hash.c (rb_hash_default): get the default value based on the block given to 'new'. Now it takes an optinal "key" argument. "default" became the method to get the value for non existing key. Users may override "default" method to change the hash behavior. Nobu Nakada