diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-12 04:38:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-12 04:38:15 +0000 |
commit | 4705fcc3c0df0d4f389aff690852356b8d2fd317 (patch) | |
tree | b17a35aa40f3209dc2bed6d046b0443581170ec0 /README.EXT | |
parent | 821ae88259f349909ae2e956b09c4d8bf35e1792 (diff) |
* README.EXT, README.EXT.ja (2.2.2), parse.y (rb_check_id): add
documents for rb_check_id().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'README.EXT')
-rw-r--r-- | README.EXT | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/README.EXT b/README.EXT index 9a6eeb0d04..a0e7a38904 100644 --- a/README.EXT +++ b/README.EXT @@ -442,11 +442,19 @@ or You can get the ID value from a string within C code by using rb_intern(const char *name) + rb_intern_str(VALUE name) You can retrieve ID from Ruby object (Symbol or String) given as an argument by using rb_to_id(VALUE symbol) + rb_check_id(volatile VALUE *name) + +These functions try to convert the argument to a String if it was not +a Symbol nor a String. The latter function stores the converted +result into *name, and returns 0 if the string is not a known symbol. +After this function returned a non-zero value, *name is always a +Symbol or a String, otherwise it is a String if the result is 0. You can convert C ID to Ruby Symbol by using |