diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-03 14:03:48 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-03 14:03:48 +0000 |
commit | 66028ab6dcd1b2ec9504c3473d817649935a4a1e (patch) | |
tree | c441ee4d665b3218e235dec24dd5a66a6fe050ef /py/obj.h | |
parent | aae7847508e2a9555ad3276c5cd4f42b2e66686c (diff) | |
download | micropython-66028ab6dcd1b2ec9504c3473d817649935a4a1e.tar.gz micropython-66028ab6dcd1b2ec9504c3473d817649935a4a1e.zip |
Basic implementation of import.
import works for simple cases. Still work to do on finding the right
script, and setting globals/locals correctly when running an imported
function.
Diffstat (limited to 'py/obj.h')
-rw-r--r-- | py/obj.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -215,11 +215,14 @@ mp_obj_t mp_obj_dict_store(mp_obj_t self_in, mp_obj_t key, mp_obj_t value); void mp_obj_set_store(mp_obj_t self_in, mp_obj_t item); // functions -typedef struct _mp_obj_fun_native_t { // need this so we can define static objects +typedef struct _mp_obj_fun_native_t { // need this so we can define const objects (to go in ROM) mp_obj_base_t base; machine_uint_t n_args_min; // inclusive machine_uint_t n_args_max; // inclusive void *fun; + // TODO add mp_map_t *globals + // for const function objects, make an empty, const map + // such functions won't be able to access the global scope, but that's probably okay } mp_obj_fun_native_t; extern const mp_obj_type_t fun_native_type; extern const mp_obj_type_t fun_bc_type; |