From: "Iñaki Baz Castillo" Date: 2009-10-21T09:05:29+09:00 Subject: Re: C extension: How to create a Hash entry with Symbol key ? [SOLVED] El Miércoles, 21 de Octubre de 2009, Iñaki Baz Castillo escribió: > Hi, I do know how to create a hash from C in wich keys and values are > strings: > > VALUE hash = rb_hash_new(); > rb_hash_aset(hash, rb_str_new("mykey",5), rb_str_new2(myvalue)); > > But now I want to create Hash entries with Symbol keys so the resulting > Hash would look like: > { :mykey => "lalala" } ops, solved right now: rb_hash_aset(hash, ID2SYM( rb_intern("mykey") ), rb_str_new2(myvalue)); :) -- Iñaki Baz Castillo