Hi,

I'm currently writing an extension. Suppose two functions, to get/set a 
String.

rb_define_method(cSimpleNode, "text",    rbxs_node_text_get, 0);
rb_define_method(cSimpleNode, "text=",   rbxs_node_text_set, 1);

I've to return duplicates of the string, because the string format is 
incompatible/the string can only be set by calling a function. So a 
gsub! will not work as expected.

I suggest something, like

VALUE rb_str_new6 _((const char*,int (*)(ANYARGS)));

to pass a function pointer to the string. I could then tell the string 
which function to call to set the string the gsub!

return(rb_str_new6(CHANGETOSTR(obj->somestring),rbxs_node_text_set));

Basically the ability to store a function pointer has to be added to 
"struct RString" to allow for this.

I'm not sure, but maybe this makes sense for some more Objects, not only 
String. (Fixnum, Array, ...)

Thanks for your comments.

Juergen