From: "Mauricio Fernández" Date: 2003-07-07T14:48:14+09:00 Subject: Re: Help with UnboundMethod#bind error On Mon, Jul 07, 2003 at 07:43:28AM +0900, Yukihiro Matsumoto wrote: > Hi, > > rb_to_id() will help. > > In message "Re: Help with UnboundMethod#bind error" > on 03/07/07, Mauricio Fern�ndez writes: > > | ID name; > > | for(i = 0; i < len; i++) { > | name = rb_to_id(rb_ary_entry(symbols, i)); > | if(!st_lookup(RCLASS(self)->m_tbl, name, &data)) > | continue; /* should do something else?? */ > | st_insert(proxy->m_tbl, name, data); Thanks. Is otherwise the code correct? I see two possible problems, but I'm not sure about them: * I believe just copying the NODE* is OK, but rb_alias makes a new one NEW_METHOD(NEW_FBODY(body, def, origin), orig->nd_noex) NODEs are GCed like any object so just copying should be safe, but I'm not really sure * is rb_clear_cache_by_name necessary after adding the proxy class? -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com And Bruce is effectively building BruceIX -- Alan Cox