typedefvoid(*mp_load_attr_fun_t)(mp_obj_tself_in,qstrattr,mp_obj_t*dest);// for fail, do nothing; for attr, dest[1] = value; for method, dest[0] = self, dest[1] = method
typedefbool(*mp_store_attr_fun_t)(mp_obj_tself_in,qstrattr,mp_obj_tvalue);// return true if store succeeded
typedefbool(*mp_store_item_fun_t)(mp_obj_tself_in,mp_obj_tindex,mp_obj_tvalue);// return true if store succeeded
typedefstruct_mp_method_t{
constchar*name;
...
...
@@ -162,6 +163,9 @@ struct _mp_obj_type_t {
mp_load_attr_fun_tload_attr;
mp_store_attr_fun_tstore_attr;
// Implements container[index] = val; note that load_item is implemented
// by binary_op(RT_BINARY_OP_SUBSCR)
mp_store_item_fun_tstore_item;
// these are for dynamically created types (classes)