Mercurial > repos > tabletprog
diff runtime/object.h @ 266:75dc7161c1ca
Added object module which provides some basic reflection capabilities
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 17 Jul 2014 23:57:41 -0700 |
parents | 18598163e3ef |
children | d2b70cba661e |
line wrap: on
line diff
--- a/runtime/object.h Mon Jul 14 19:03:46 2014 -0700 +++ b/runtime/object.h Thu Jul 17 23:57:41 2014 -0700 @@ -4,6 +4,8 @@ #include <stdint.h> #include <stdarg.h> +#define LAST_METHOD 0xFFFFFFFF + typedef struct obj_meta obj_meta; typedef struct object @@ -27,6 +29,7 @@ { uint32_t size; method meth_lookup[16]; + uint32_t *methods[16]; }; extern obj_meta lambda_meta; @@ -38,5 +41,6 @@ object * make_lambda(void * env, closure_func func); object * make_array(uint32_t num_els, ...); object * make_list(uint32_t num_els, ...); +int object_understands(object * obj, uint32_t method_id); #endif //OBJECT_H_