Sha256: 3bb9fb05587d5139aab7230315e987be89c8c4f240e0ee1f06ef02dccc0536a4

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

#include "rubype.h"

VALUE rb_mRubype, rb_cAny, rb_mBoolean, rb_cTypePair;

#define STR2SYM(x) ID2SYM(rb_intern(x))

static VALUE
rb_mod_prepend(int argc, VALUE *argv, VALUE module)
{
  int i;
  ID id_prepend_features, id_prepended;

  CONST_ID(id_prepend_features, "prepend_features");
  CONST_ID(id_prepended, "prepended");
  for (i = 0; i < argc; i++)
    Check_Type(argv[i], T_MODULE);
    while (argc--) {
      rb_funcall(argv[argc], id_prepend_features, 1, module);
      rb_funcall(argv[argc], id_prepended, 1, module);
    }

  return module;
}

void
Init_rubype(void)
{
  // rb_mRubype  = rb_define_module("Rubype");
  // rb_cAny     = rb_define_class("Any", rb_cObject);
  // rb_mBoolean = rb_define_module("Boolean");
  // rb_include_module(rb_cTrueClass, rb_mBoolean);
  // rb_include_module(rb_cFalseClass, rb_mBoolean);
  // rb_define_class(
  //   "TypePair",
  //   rb_funcall(rb_cStruct, rb_intern("new"), 2, STR2SYM("last_arg_type"), STR2SYM("rtn_type"))
  // );
  rb_define_method(rb_cModule, "prepend", rb_mod_prepend, -1);
}

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
rubype-0.2.6 ext/rubype/rubype.c
rubype-0.2.5 ext/rubype/rubype.c
rubype-0.2.4 ext/rubype/rubype.c
rubype-0.2.3 ext/rubype/rubype.c
rubype-0.2.2 ext/rubype/rubype.c
rubype-0.2.1 ext/rubype/rubype.c
haskell-0.2.2 ext/haskell/haskell.c
haskell-0.2.0 ext/rubype/rubype.c
rubype-0.2.0 ext/rubype/rubype.c