Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Jul 29, 2024
1 parent db98fc3 commit 333cdc5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 29 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.211
0.5.212
7 changes: 1 addition & 6 deletions include/meevax/kernel/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::pair<in, object>> contexts;
Expand Down
16 changes: 5 additions & 11 deletions include/meevax/kernel/syntactic_environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<null>());
}
: object { expression }
{}

template <typename... Ts>
auto cons(let const& a,
Expand All @@ -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<decltype(xs)>(xs)...));
return cons2(a, cons(b, std::forward<decltype(xs)>(xs)...));
}
else
{
Expand Down
12 changes: 4 additions & 8 deletions src/kernel/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -133,17 +129,17 @@ 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())
{
output << "; " << context->second << ": " << x << std::endl;
}
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;
Expand Down

0 comments on commit 333cdc5

Please sign in to comment.