added the #dual modifier to method definition. a method defined with #dual is registered in both the instance side and the class side.

This commit is contained in:
hyunghwan.chung
2017-04-26 03:09:55 +00:00
parent 8298bad3e0
commit 04864659a8
3 changed files with 52 additions and 20 deletions

View File

@ -171,14 +171,11 @@ typedef struct moo_obj_word_t* moo_oop_word_t;
#endif
enum moo_method_type_t
{
MOO_METHOD_INSTANCE = 0,
MOO_METHOD_CLASS = 1,
/* --------------------------- */
MOO_METHOD_TYPE_COUNT
MOO_METHOD_DUAL = 2
};
typedef enum moo_method_type_t moo_method_type_t;
@ -511,7 +508,7 @@ struct moo_class_t
/* [0] - instance methods, MethodDictionary
* [1] - class methods, MethodDictionary */
moo_oop_set_t mthdic[MOO_METHOD_TYPE_COUNT];
moo_oop_set_t mthdic[2];
moo_oop_set_t nsdic; /* dictionary used for namespacing */
moo_oop_set_t cdic; /* constant dictionary */