示例#1
0
  NativeFunction* NativeFunction::create(STATE, Object* name, int args) {
    NativeFunction* nf = (NativeFunction*)state->new_object(G(native_function));
    nf->primitive(state, state->symbol("nativefunction_call"));
    nf->required(state, Fixnum::from(args));
    nf->serial(state, Fixnum::from(0));
    nf->name(state, name);
    nf->file(state, state->symbol("<system>"));
    nf->data(state, (MemoryPointer*)Qnil);

    nf->set_executor(NativeFunction::execute);

    return nf;
  }