Mercurial > repos > tabletprog
comparison runtime/object.h @ 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 |
comparison
equal
deleted
inserted
replaced
33:96e21f525b78 | 34:a10f1b049193 |
---|---|
26 { | 26 { |
27 uint32_t size; | 27 uint32_t size; |
28 method meth_lookup[16]; | 28 method meth_lookup[16]; |
29 }; | 29 }; |
30 | 30 |
31 extern obj_meta lambda_meta; | |
32 | |
31 #define mcall(method_id, num_args, args) (args[0])->meta->meth_lookup[method_id & 0xF](method_id, num_args, args) | 33 #define mcall(method_id, num_args, args) (args[0])->meta->meth_lookup[method_id & 0xF](method_id, num_args, args) |
32 #define ccall(clos, num_args, args) (((closure *)clos)->func(((closure *)clos)->env, num_args, args)) | 34 #define ccall(clos, num_args, args) (((closure *)clos)->func(((closure *)clos)->env, num_args, args)) |
33 | 35 |
34 object * make_object(obj_meta * meta, void * parent, int num_props, ...); | 36 object * make_object(obj_meta * meta, void * parent, int num_props, ...); |
37 object * make_closure(void * env, closure_func func); | |
35 | 38 |
36 #endif //OBJECT_H_ | 39 #endif //OBJECT_H_ |