From 01efeb03801c5a9b06de7bcc92cd0be170b4ce13 Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Sat, 11 Jun 2022 14:52:31 +0900 Subject: [PATCH] Update `configurator::long_options_with_arguments` to be static Signed-off-by: yamacir-kit --- README.md | 6 ++-- VERSION | 2 +- include/meevax/kernel/configurator.hpp | 41 +++++++++++++------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d90d45e29..7e462a423 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |:-------------------|:-- -| `all` (default) | Build shared-library `libmeevax.0.4.56.so` and executable `meevax`. +| `all` (default) | Build shared-library `libmeevax.0.4.57.so` and executable `meevax`. | `test` | Test executable `meevax`. -| `package` | Generate debian package `meevax_0.4.56_amd64.deb`. +| `package` | Generate debian package `meevax_0.4.57_amd64.deb`. | `install` | Copy files into `/usr/local` __(1)__. | `install.deb` | `all` + `package` + `sudo apt install .deb` | `safe-install.deb` | `all` + `test` + `package` + `sudo apt install .deb` @@ -120,7 +120,7 @@ __(1)__ Meevax installed by `make install` cannot be uninstalled by the system's ## Usage ``` -Meevax Lisp System, version 0.4.56 +Meevax Lisp System, version 0.4.57 Usage: meevax [OPTION...] [FILE...] diff --git a/VERSION b/VERSION index 319405ebd..b0da4c03b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.56 +0.4.57 diff --git a/include/meevax/kernel/configurator.hpp b/include/meevax/kernel/configurator.hpp index 81ce30aad..bbfb073bc 100644 --- a/include/meevax/kernel/configurator.hpp +++ b/include/meevax/kernel/configurator.hpp @@ -34,6 +34,9 @@ inline namespace kernel { friend environment; + explicit configurator() + {} + IMPORT(environment, evaluate, NIL); IMPORT(environment, load, NIL); IMPORT(environment, read, NIL); @@ -43,8 +46,6 @@ inline namespace kernel template using dispatcher = std::unordered_map; - const dispatcher long_options_with_arguments; - public: static inline auto batch = false; static inline auto debug = false; @@ -167,27 +168,27 @@ inline namespace kernel }), }; - public: - explicit configurator() - : long_options_with_arguments - { - std::make_pair("evaluate", [this](const_reference x, auto&&...) - { - return print(evaluate(x)), unspecified_object; - }), + static inline const dispatcher long_options_with_arguments + { + std::make_pair("evaluate", [](const_reference x, auto&&...) + { + print(interaction_environment().as().evaluate(x)); + return unspecified_object; + }), - std::make_pair("load", [this](const_reference x, auto&&...) - { - return load(x.as_const()); - }), + std::make_pair("load", [](const_reference x, auto&&...) + { + return interaction_environment().as().load(x.as_const()); + }), - std::make_pair("write", [this](const_reference x, auto&&...) - { - return print(x), unspecified_object; - }), - } - {} + std::make_pair("write", [](const_reference x, auto&&...) + { + print(x); + return unspecified_object; + }), + }; + public: auto configure(const int argc, char const* const* const argv) { return configure({ argv + 1, argv + argc });