[DOC] Rewrite docs for rb_sym2str()
Explaining this by reference to rb_id2str() obscures a few important details because IDs and symbols don't map to each other perfectly (you can have a dynamic symbol without an ID!) Also, it used to take 2 redirections to get to concrete information, and I think being more direct is friendlier.
This commit is contained in:
parent
2a0006c101
commit
88764dde78
@ -202,14 +202,14 @@ ID rb_to_id(VALUE str);
|
|||||||
VALUE rb_id2str(ID id);
|
VALUE rb_id2str(ID id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identical to rb_id2str(), except it takes an instance of ::rb_cSymbol rather
|
* Obtain a frozen string representation of a symbol (not including the leading
|
||||||
* than an ::ID.
|
* colon). Done without any object allcoations.
|
||||||
*
|
*
|
||||||
* @param[in] id An id to query.
|
* @param[in] symbol A ::rb_cSymbol instance to query.
|
||||||
* @retval RUBY_Qfalse No such id ever existed in the history.
|
* @return A frozen instance of ::rb_cString with the name of `symbol`.
|
||||||
* @retval otherwise An instance of ::rb_cString with the name of id.
|
* @note This does not create a permanent ::ID using the symbol.
|
||||||
*/
|
*/
|
||||||
VALUE rb_sym2str(VALUE id);
|
VALUE rb_sym2str(VALUE symbol);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identical to rb_intern_str(), except it generates a dynamic symbol if
|
* Identical to rb_intern_str(), except it generates a dynamic symbol if
|
||||||
|
Loading…
x
Reference in New Issue
Block a user