diff --git a/compiler+runtime/src/cpp/jank/runtime/core.cpp b/compiler+runtime/src/cpp/jank/runtime/core.cpp index 320da6a2..7858aadd 100644 --- a/compiler+runtime/src/cpp/jank/runtime/core.cpp +++ b/compiler+runtime/src/cpp/jank/runtime/core.cpp @@ -235,8 +235,10 @@ namespace jank::runtime o); } - object_ptr force(object_ptr const o) { - if (o->type == object_type::delay) { + object_ptr force(object_ptr const o) + { + if(o->type == object_type::delay) + { return expect_object(o)->deref(); } return o; diff --git a/compiler+runtime/src/cpp/jank/runtime/obj/delay.cpp b/compiler+runtime/src/cpp/jank/runtime/obj/delay.cpp index f63ead98..e1bac0df 100644 --- a/compiler+runtime/src/cpp/jank/runtime/obj/delay.cpp +++ b/compiler+runtime/src/cpp/jank/runtime/obj/delay.cpp @@ -16,10 +16,9 @@ namespace jank::runtime { fmt::memory_buffer buff; to_string(buff); - return native_persistent_string{buff.data(), buff.size()}; + return native_persistent_string{ buff.data(), buff.size() }; } - void obj::delay::to_string(fmt::memory_buffer &buff) const { fmt::format_to(std::back_inserter(buff), @@ -40,25 +39,28 @@ namespace jank::runtime object_ptr obj::delay::deref() { - std::lock_guard const lock{mutex}; + std::lock_guard const lock{ mutex }; if(val != nullptr) { return val; } - if (error != nullptr) { + if(error != nullptr) + { throw error; } - try { + try + { val = dynamic_call(fn); } - catch (std::exception const &e) + catch(std::exception const &e) { error = make_box(e.what()); throw; } - catch (object_ptr const e) { + catch(object_ptr const e) + { error = e; throw; }