Mercurial > repos > tabletprog
view runtime/progfoot.inc @ 34:a10f1b049193
Working closures, but need to rethink method call strategy
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 09 Jul 2012 08:57:50 -0700 |
parents | 668f533e5284 |
children | bf5e88f6419d |
line wrap: on
line source
int main(int argc, char ** argv) { object * params[64]; params[0] = mainModule(); object * ret = mcall(METHOD_ID_MAIN, 1, params); printf("%p:%p\n", ret->meta, &obj_int32_meta); if (ret->meta == &obj_int32_meta) { obj_int32 * reti32 = (obj_int32 *) ret; printf("%d\n", reti32->num); } else if(ret->meta == &lambda_meta) { puts("returned lambda????"); } else { int i = 0; for(; i < 16; ++i) { if (ret->meta->meth_lookup[i] != &no_impl) { printf("slot %d is set\n", i); } } } return 0; }