Skip to content

Instantly share code, notes, and snippets.

@bamchoh
Created February 10, 2014 15:45
Show Gist options
  • Save bamchoh/8918182 to your computer and use it in GitHub Desktop.
Save bamchoh/8918182 to your computer and use it in GitHub Desktop.
@DaTa ||= []
mrb_value
mrb_data_data(mrb_state *mrb, mrb_value self)
{
mrb_value v;
v = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@data"));
if(mrb_nil_p(v)) {
mrb_iv_set(mrb, self, mrb_intern_lit(mrb, "@data"), mrb_ary_new(mrb));
v = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@data"));
}
return v;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment