Skip to content

Instantly share code, notes, and snippets.

@arnsholt
Created March 23, 2013 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnsholt/5227768 to your computer and use it in GitHub Desktop.
Save arnsholt/5227768 to your computer and use it in GitHub Desktop.
Tweaked VTABLE_does
VTABLE INTVAL does(STRING *what) {
PMC *decont = decontainerize(interp, SELF);
if (Parrot_str_equal(interp, what, CONST_STRING(interp, "invokable"))) {
return 1;
}
else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "array"))) {
return Parrot_str_equal(interp, REPR(decont)->name, CONST_STRING(interp, "VMArray"));
}
else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "hash"))) {
return Parrot_str_equal(interp, REPR(decont)->name, CONST_STRING(interp, "VMHash"));
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment