Actions
Feature #15338
openProvide way for C extensions to query if global variable is defined
    Feature #15338:
    Provide way for C extensions to query if global variable is defined
  
Status:
Open
Assignee:
-
Target version:
-
Description
As far as I can tell, there is no way for C extension to check if global variable is defined. I can rb_gv_get, but that produces warning when $VERBOSE = true.
Let's introduce third function rb_gv_defined to complement rb_gv_get and rb_gv_set.
PS: At the moment I'm doing if (RTEST(rb_eval_string("defined?($XX) && $XX"))) { ... } but there's got to be a better way, right?
Files
Actions