David Alan Black <dblack / candle.superlink.net> writes:

> On Wed, 10 Jan 2001, Yukihiro Matsumoto wrote:
> 
> > Hi,
> > 
> > In message "[ruby-talk:8925] Re: bug??"
> >     on 01/01/09, Dave Thomas <Dave / PragmaticProgrammer.com> writes:
> > 
> > |Except we could have the best of both worlds: if the default value was 
> > |a proc, then it could be called to supply the value to use.
> > 
> > I don't think changing the behavior depending on the type (except by
> > using polymorphism, of course) is a good idea.
> 
> 
> Also, getting the best of both worlds is still possible, as long as
> there's a block, without making the #call magic:

But I was suggesting we can do it without needing the block to ::new (just a
kind of upward compatible hack).

   a = {}
   a.default = proc {|key| ...}

Just a thought,


Dave