On Oct 12, 2009, at 9:24 AM, I=F1aki Baz Castillo wrote:

> Hi, I've found some tutorials explaining how to create and manipulat =20=

> a Ruby
> array from a C extension using T_ARRAY and its realted functions.
> However I find nothing about T_HASH, and trying to extract the =20
> functions from
> Ruby "hash.c" code is... not very cool.

Sure it is!  All of the hipsters at Beauty Bar were talking about it =20
the other night.  But you'd better hop on board quickly before it =20
becomes uncool, otherwise you're going to have to wait until it =20
becomes "retro cool".

> Is there any tutorial about creating a simple hash in Ruby C =20
> extension?

rb_hash_new(void)
rb_hash_aset(VALUE hash, VALUE key, VALUE val)
rb_hash_aref(VALUE hash, VALUE key)

Though, if you're just doing hash manipulation, why not just do it in =20=

Ruby?

---
Aaron Patterson
http://tenderlovemaking.com