diff --git a/compiler+runtime/include/cpp/jank/runtime/module/loader.hpp b/compiler+runtime/include/cpp/jank/runtime/module/loader.hpp index 53d4d60a..3cab6c7f 100644 --- a/compiler+runtime/include/cpp/jank/runtime/module/loader.hpp +++ b/compiler+runtime/include/cpp/jank/runtime/module/loader.hpp @@ -95,9 +95,6 @@ namespace jank::runtime::module loader(context &rt_ctx, native_persistent_string_view const &ps); - native_bool is_loaded(native_persistent_string_view const &) const; - void set_loaded(native_persistent_string_view const &); - string_result find(native_persistent_string_view const &module, origin const ori); string_result load(native_persistent_string_view const &module, origin const ori); @@ -115,6 +112,5 @@ namespace jank::runtime::module /* This maps module strings to entries. Module strings are like fully qualified Java * class names. */ native_unordered_map entries; - native_set loaded; }; } diff --git a/compiler+runtime/src/cpp/clojure/core_native.cpp b/compiler+runtime/src/cpp/clojure/core_native.cpp index 8dbd603c..f388ab29 100644 --- a/compiler+runtime/src/cpp/clojure/core_native.cpp +++ b/compiler+runtime/src/cpp/clojure/core_native.cpp @@ -255,17 +255,6 @@ namespace clojure::core_native return obj::nil::nil_const(); } - static object_ptr is_module_loaded(object_ptr const path) - { - return make_box(__rt_ctx->module_loader.is_loaded(runtime::to_string(path))); - } - - static object_ptr set_module_loaded(object_ptr const path) - { - __rt_ctx->module_loader.set_loaded(runtime::to_string(path)); - return obj::nil::nil_const(); - } - static object_ptr compile(object_ptr const path) { __rt_ctx->compile_module(runtime::to_string(path)).expect_ok(); @@ -465,8 +454,6 @@ jank_object_ptr jank_load_clojure_core_native() intern_fn("alias", &core_native::alias); intern_fn("refer", &core_native::refer); intern_fn("load-module", &core_native::load_module); - intern_fn("set-module-loaded", &core_native::set_module_loaded); - intern_fn("module-loaded?", &core_native::is_module_loaded); intern_fn("compile", &core_native::compile); /* TODO: jank.math? */ diff --git a/compiler+runtime/src/cpp/jank/runtime/core/seq.cpp b/compiler+runtime/src/cpp/jank/runtime/core/seq.cpp index 6a0ae325..e64439a2 100644 --- a/compiler+runtime/src/cpp/jank/runtime/core/seq.cpp +++ b/compiler+runtime/src/cpp/jank/runtime/core/seq.cpp @@ -674,7 +674,8 @@ namespace jank::runtime { return typed_s->contains(key); } - if constexpr(std::same_as) + if constexpr(std::same_as + || std::same_as) { return typed_s->contains(key); } diff --git a/compiler+runtime/src/cpp/jank/runtime/module/loader.cpp b/compiler+runtime/src/cpp/jank/runtime/module/loader.cpp index bf004367..dfa6bb3a 100644 --- a/compiler+runtime/src/cpp/jank/runtime/module/loader.cpp +++ b/compiler+runtime/src/cpp/jank/runtime/module/loader.cpp @@ -343,16 +343,6 @@ namespace jank::runtime::module return boost::filesystem::last_write_time(native_transient_string{ source_path }); } - native_bool loader::is_loaded(native_persistent_string_view const &module) const - { - return loaded.contains(module); - } - - void loader::set_loaded(native_persistent_string_view const &module) - { - loaded.emplace(module); - } - string_result loader::find(native_persistent_string_view const &module, origin const ori) { @@ -440,11 +430,6 @@ namespace jank::runtime::module string_result loader::load(native_persistent_string_view const &module, origin const ori) { - if(loader::is_loaded(module)) - { - return ok(); - } - auto const &found_module{ loader::find(module, ori) }; if(found_module.is_err()) { @@ -477,8 +462,6 @@ namespace jank::runtime::module return res; } - loader::set_loaded(module); - return ok(); } diff --git a/compiler+runtime/src/jank/clojure/core.jank b/compiler+runtime/src/jank/clojure/core.jank index 2a4c2983..f646ee43 100644 --- a/compiler+runtime/src/jank/clojure/core.jank +++ b/compiler+runtime/src/jank/clojure/core.jank @@ -3817,8 +3817,8 @@ (defn- load-all "Loads a lib given its name and forces a load of any libs it directly or - indirectly loads. If need-ns, ensures that the associated namespace - exists after loading. If require, records the load so any duplicate loads + indirectly loads. If need-ns?, ensures that the associated namespace + exists after loading. If require?, records the load so any duplicate loads can be skipped." [lib need-ns? require?] (swap! *loaded-libs* #(reduce conj %1 %2)