From: Yukihiro Matsumoto Date: 2006-04-08T02:07:12+09:00 Subject: Re: rb_hash_aref and symbol keys In message "Re: rb_hash_aref and symbol keys" on Sat, 8 Apr 2006 01:16:48 +0900, Andre Nathan writes: | |On Sat, 2006-04-08 at 00:02 +0900, Yukihiro Matsumoto wrote: |> rb_intern() gives you ID, which is a mere C number. You have to |> convert it into a Ruby Symbol Object by using ID2SYM() macro. | |Thank you Matz. Is this documented anywhere? It's not mentioned in |README.EXT. I will update the following section in README.EXT: 2.2.2 ID or Symbol You can invoke methods directly, without parsing the string. First I need to explain about ID. ID is the integer number to represent Ruby's identifiers such as variable names. The Ruby data type corresponding to ID is Symbol. It can be accessed from Ruby in the form: :Identifier You can get the ID value from a string within C code by using rb_intern(const char *name) You can convert C ID to Ruby Symbol by using VALUE ID2SYM(ID id) and to convert Ruby Symbol to ID, use ID SYM2ID(VALUE sym) -- matz.