[#1551] Hashes as keys — "Nathaniel Talbott" <nathaniel@...>

I was just playing around with Hash#hash and discovered that you can't use a

13 messages 2003/09/23

Re: ostruct.rb patch

From: nobu.nokada@...
Date: 2003-09-24 05:59:43 UTC
List: ruby-core #1562
Hi,

At Wed, 24 Sep 2003 11:26:59 +0900,
NAKAMURA, Hiroshi wrote:
> > > You can use protected method to avoid this kind of 
> > > instance_eval. Ignore me if it's intentional.
> > 
> > I hadn't thought of that. Do you think a protected method is better? I'm
> > assuming it's probably faster.

Perhaps.  The instance_eval needs to push the block whereas a
protected method doesn't.

> I think so.  From my ruby life for now, here's the only place
> where protected method lives.
> 
> It may be wrong.  Folks, tell me your "protected method" recipe
> if you have good one.

I guess you're right.

-- 
Nobu Nakada

In This Thread