From: Akinori MUSHA Date: 2000-10-31T02:46:12+09:00 Subject: [ruby-talk:5948] Re: Hash.new {block} / Hash#default_proc{,_set} Hey, Brian! At Tue, 31 Oct 2000 01:47:09 +0900, Brian F. Feldman wrote: > I've done very little testing, but I think I've successfully implemented the > ability for a Hash to provide a default procedure rather than variable. > > The only reasonable way I could think of doing this required on-the-fly > creation of a hash entry when a lookup fails -- otherwise, this feature is > nearly useless (does not make anything easier). > > Here's the diff, my 3rd time modifying Ruby code itself. Comments? Neat! I always wanted that. I was about to do it myself, but you've now done it. Your next target will be Array#new(size) {...}, I presume? :> I'd really like to see them merged. :) -- / /__ __ / ) ) ) ) / and.or.jp / ruby-lang.org Akinori -Aki- MUSHA aka / (_ / ( (__( @ idaemons.org / FreeBSD.org "We're only at home when we're on the run, on the wing, on the fly"