From: Joel VanderWerf Date: 2004-06-01T04:43:06+09:00 Subject: clarify README.EXT regarding symbols I'd like to propose a clarification for README.EXT, after forgotting (again) that symbols can be represented as ID and as VALUEs. What I forgot was that you have to use ID2SYM to convert ID -> VALUE. README.EXT doesn't mention this. The original text is quoted below, followed by my proposed addition (maybe it would be better in different part of the file, possibly section 1.4): > 2.2.2 ID or Symbol > > You can invoke methods directly, without parsing the string. First I > need to explain about symbols (whose data type is ID). ID is the > integer number to represent Ruby's identifiers such as variable names. > It can be accessed from Ruby in the form: > > :Identifier > > You can get the symbol value from a string within C code by using > > rb_intern(const char *name) The ID of a symbol is not the same as the ruby VALUE that represents the symbol as an object. If you want this VALUE, use the ID2SYM macro: ID id_sym = rb_intern("a_symbol"); VALUE val_sym = ID2SYM(id);