示例#1
0
文件: array.c 项目: singpolyma/tinyrb
void TrArray_init(VM) {
  OBJ c = TR_INIT_CORE_CLASS(Array, Object);
  tr_def(c, "length", TrArray_length, 0);
  tr_def(c, "size", TrArray_length, 0);
  tr_def(c, "<<", TrArray_push, 1);
  tr_def(c, "[]", TrArray_at, 1);
  tr_def(c, "[]=", TrArray_set, 2);
}
示例#2
0
文件: range.c 项目: AntiTyping/tinyrb
void TrRange_init(VM) {
  OBJ c = TR_INIT_CORE_CLASS(Range, Object);
  tr_def(c, "first", TrRange_first, 0);
  tr_def(c, "last", TrRange_last, 0);
  tr_def(c, "exclude_end?", TrRange_exclude_end, 0);
}
示例#3
0
void TrBinding_init(VM) {
  TR_INIT_CORE_CLASS(Binding, Object);
}