From 333cdc53bdb68f0e2341c19b989eaf0d3aa3ccb5 Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Tue, 30 Jul 2024 02:46:58 +0900 Subject: [PATCH] Cleanup Signed-off-by: yamacir-kit --- README.md | 6 +++--- VERSION | 2 +- include/meevax/kernel/error.hpp | 7 +------ include/meevax/kernel/syntactic_environment.hpp | 16 +++++----------- src/kernel/error.cpp | 12 ++++-------- 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 524303a59..c8c856268 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.5.211_amd64.deb +sudo apt install build/meevax_0.5.212_amd64.deb ``` or @@ -122,9 +122,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.211.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.212.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.211_amd64.deb` +| `package` | Generate debian package `meevax_0.5.212_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 5f635065b..27f4cc7da 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.211 +0.5.212 diff --git a/include/meevax/kernel/error.hpp b/include/meevax/kernel/error.hpp index 4a20c9165..e4f0822f8 100644 --- a/include/meevax/kernel/error.hpp +++ b/include/meevax/kernel/error.hpp @@ -29,12 +29,7 @@ inline namespace kernel { enum class in { - evaluating, - compiling, - expanding, - generating, - optimizing, - running, + evaluating, expanding, generating, running, }; static thread_local inline std::vector> contexts; diff --git a/include/meevax/kernel/syntactic_environment.hpp b/include/meevax/kernel/syntactic_environment.hpp index 2c688e736..029ce1e45 100644 --- a/include/meevax/kernel/syntactic_environment.hpp +++ b/include/meevax/kernel/syntactic_environment.hpp @@ -95,15 +95,11 @@ inline namespace kernel , generate { generate } {} - struct constructor + struct constructor : private object { - let const& expression; - explicit constructor(let const& expression) - : expression { expression } - { - assert(not expression.is()); - } + : object { expression } + {} template auto cons(let const& a, @@ -112,15 +108,13 @@ inline namespace kernel auto cons2 = [&](let const& a, let const& b) { let const& x = meevax::cons(a, b); - contexts[x.get()] = expression; + contexts[x.get()] = *this; return x; }; if constexpr (0 < sizeof...(Ts)) { - return cons2(a, - cons(b, - std::forward(xs)...)); + return cons2(a, cons(b, std::forward(xs)...)); } else { diff --git a/src/kernel/error.cpp b/src/kernel/error.cpp index 7788c1593..af04541ce 100644 --- a/src/kernel/error.cpp +++ b/src/kernel/error.cpp @@ -31,10 +31,6 @@ inline namespace kernel auto error::make() const -> object { - /* - When a class that publicly inherits pair is made, the pair constructor - is called with priority, so not all data members are copied. - */ return meevax::make(*this); } @@ -133,6 +129,10 @@ inline namespace kernel { switch (doing) { + case in::running: + // disassemble(output, car(x)); // Disabled as it is still experimental and does not produce any useful output. + [[fallthrough]]; + case in::evaluating: // x is expression if (auto context = textual_input_port::contexts.find(x.get()); context != textual_input_port::contexts.end()) { @@ -140,10 +140,6 @@ inline namespace kernel } break; - case in::running: - // disassemble(output, car(x)); // Disabled as it is still experimental and does not produce any useful output. - break; - default: assert(false); break;