[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby_top_self in 1.9

Roger Pack

6/7/2009 3:44:00 AM

with ruby 1.8 C code, I can (apparently) do the following to define a
top level method called "go"

file Test3.c

static void toplevel_scope_1(VALUE self, NODE *cref) {
VALUE s_class = (cref)->nd_clss;
rb_define_private_method(s_class, "go", method_1, -1);
}

void Init_test3() {
NODE *cref = rb_node_newnode(NODE_CREF, rb_cObject, 0, 0);
toplevel_scope_1(ruby_top_self, cref);
}

So anybody have any clues how to do that in 1.9?
Thanks!
-=r
--
Posted via http://www.ruby-....