diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-05 22:36:42 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-05 22:36:42 +0100 |
| commit | 7efc5b3f346869cd4177760e6a6b2bb863b425da (patch) | |
| tree | 04fbe840f20ab84bee79d28882601812279c8718 /py/objfun.c | |
| parent | 8b0535e23fb1c646103a060a4ae17e9ee6d5e887 (diff) | |
py: Make globals and locals proper dictionary objects.
Finishes addressing issue #424.
In the end this was a very neat refactor that now makes things a lot
more consistent across the py code base. It allowed some
simplifications in certain places, now that everything is a dict object.
Also converted builtins tables to dictionaries. This will be useful
when we need to turn builtins into a proper module.
Diffstat (limited to 'py/objfun.c')
| -rw-r--r-- | py/objfun.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objfun.c b/py/objfun.c index d006c8715..0b0df3ba4 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -152,7 +152,7 @@ mp_obj_t mp_make_function_var_between(int n_args_min, int n_args_max, mp_fun_var typedef struct _mp_obj_fun_bc_t { mp_obj_base_t base; - mp_map_t *globals; // the context within which this function was defined + mp_obj_dict_t *globals; // the context within which this function was defined machine_uint_t n_args : 15; // number of arguments this function takes machine_uint_t n_def_args : 15; // number of default arguments machine_uint_t takes_var_args : 1; // set if this function takes variable args @@ -326,7 +326,7 @@ continue2:; } } - mp_map_t *old_globals = mp_globals_get(); + mp_obj_dict_t *old_globals = mp_globals_get(); mp_globals_set(self->globals); mp_obj_t result; DEBUG_printf("Calling: args=%p, n_args=%d, extra_args=%p, n_extra_args=%d\n", args, n_args, extra_args, n_extra_args); |
