# Namespace --- ## Object Definitions ```c typedef struct _kpl_export { KPL_SLAB_TREE_HEADER(struct _kpl_export); kpl_type_ptr type; } kpl_export; typedef struct _kpl_namespace_native { KPL_SLAB_TREE_HEADER(struct _kpl_namespace_native); kpl_buffer *name; kpl_export *exports; } kpl_namespace_native; static kpl_namespace_native *namespace_native_head; typedef struct _kpl_namespace_module { KPL_SLAB_TREE_HEADER(struct _kpl_namespace_module); kpl_type_ptr ast; kpl_queue *parents; kpl_buffer *module_name, *module_string; kpl_export *exports; kpl_task *task; _Atomic int32_t children; } kpl_namespace_module; static kpl_namespace_module *namespace_module_head; typedef struct _kpl_namespace_string { kpl_buffer *string; kpl_task *task; kpl_type_ptr ast; _Atomic int32_t children; } kpl_namespace_string; ``` Each `NAMESPACE_IDENTIFIER` maps to `kpl_namespace_native*` or `kpl_namespace_module*` depending on flags ## Lookup and Storage The native and namespace objects are stored as a tree under `namespace_native_head` and `namespace_module_head` The exports are stored under a tree for both the native and namespace objects # Registering ## Native ## Module ### Main ### ``import` ## String/REPL # Updating ## Module ### ``export` # Using ## Native ### ``use` ## Module ### ``import`