Skip to content

Commit

Permalink
Update configurator::long_options_with_arguments to be static
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Jun 11, 2022
1 parent e220136 commit 01efeb0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <meevax>.deb`
| `safe-install.deb` | `all` + `test` + `package` + `sudo apt install <meevax>.deb`
Expand All @@ -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...]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.56
0.4.57
41 changes: 21 additions & 20 deletions include/meevax/kernel/configurator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ inline namespace kernel
{
friend environment;

explicit configurator()
{}

IMPORT(environment, evaluate, NIL);
IMPORT(environment, load, NIL);
IMPORT(environment, read, NIL);
Expand All @@ -43,8 +46,6 @@ inline namespace kernel
template <typename Key>
using dispatcher = std::unordered_map<Key, procedure::function_type>;

const dispatcher<std::string> long_options_with_arguments;

public:
static inline auto batch = false;
static inline auto debug = false;
Expand Down Expand Up @@ -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<std::string> long_options_with_arguments
{
std::make_pair("evaluate", [](const_reference x, auto&&...)
{
print(interaction_environment().as<environment>().evaluate(x));
return unspecified_object;
}),

std::make_pair("load", [this](const_reference x, auto&&...)
{
return load(x.as_const<string>());
}),
std::make_pair("load", [](const_reference x, auto&&...)
{
return interaction_environment().as<environment>().load(x.as_const<string>());
}),

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 });
Expand Down

0 comments on commit 01efeb0

Please sign in to comment.