From: Florian Frank Date: 2003-12-24T09:56:18+09:00 Subject: Re: Does String cache its 'hash' return value? On Wed, 2003-12-24 at 01:06, Asfand Yar Qazi wrote: > Depends... if Symbols are used as the keys for a hash table, can they be > as easily accessed from extension modules as if Strings were used? You can use ID2SYM(rb_intern("foo")) to get the VALUE of symbol :foo. I don't think it's too complicated. -- o=lambda{|o|p o};O=Struct.new(:a,:b,:c);e=%q(_(?h,_(?h,_(?\ ,_(?s,_(?u,_(74)), _(?t)),_(?t,_(?o,_(?n,_(?a))))),_(82,_(?r,_(?e),_(32)),_(32,_(98,_(?u),_(?y))) )),_(?r,_(99,_(97),_(?k,nil,_(?e))),_(10))));def _(*a)O.new(*a)end;class O;def e(&o)b&&b.e(&o);o[a];c&&c.e(&o)end;end;def p(o)print(''<