diff --git a/CMakeLists.txt b/CMakeLists.txt index a9b46b3c8..6008cbafa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,8 +68,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT add_library(kernel SHARED) -add_library(${PROJECT_NAME}::kernel ALIAS kernel) - file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp) target_sources(kernel PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES}) diff --git a/README.md b/README.md index adf253ff1..0895557dc 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,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.60_amd64.deb +sudo apt install build/meevax_0.5.61_amd64.deb ``` or @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.60.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.61.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.60_amd64.deb` +| `package` | Generate debian package `meevax_0.5.61_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index dd78e5f59..57bba1228 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.60 +0.5.61 diff --git a/include/meevax/kernel/boolean.hpp b/include/meevax/kernel/boolean.hpp index f73009d42..8a0065fc6 100644 --- a/include/meevax/kernel/boolean.hpp +++ b/include/meevax/kernel/boolean.hpp @@ -24,9 +24,8 @@ namespace meevax inline namespace kernel { let extern const t; - let extern const f; - auto is_truthy(object const&) -> bool; + let extern const f; } // namespace kernel } // namespace meevax diff --git a/include/meevax/kernel/dynamic_environment.hpp b/include/meevax/kernel/dynamic_environment.hpp index 62a6db453..9f50c4db6 100644 --- a/include/meevax/kernel/dynamic_environment.hpp +++ b/include/meevax/kernel/dynamic_environment.hpp @@ -256,7 +256,7 @@ inline namespace kernel * where c' = (if c1 c2) * * ----------------------------------------------------------------- */ - c = is_truthy(car(s)) ? cadr(c) : caddr(c); + c = car(s) != f ? cadr(c) : caddr(c); s = cdr(s); goto fetch; diff --git a/include/meevax/kernel/syntactic_environment.hpp b/include/meevax/kernel/syntactic_environment.hpp index f77338d19..61417f644 100644 --- a/include/meevax/kernel/syntactic_environment.hpp +++ b/include/meevax/kernel/syntactic_environment.hpp @@ -190,17 +190,17 @@ inline namespace kernel * call to one of their arguments. Exceptions are noted in the individual * descriptions. * - * Note: In contrast to other dialects of Lisp, the order of evaluation + * NOTE: In contrast to other dialects of Lisp, the order of evaluation * is unspecified, and the operator expression and the operand * expressions are always evaluated with the same evaluation rules. * - * Note: Although the order of evaluation is otherwise unspecified, the + * NOTE: Although the order of evaluation is otherwise unspecified, the * effect of any concurrent evaluation of the operator and operand * expressions is constrained to be consistent with some sequential order * of evaluation. The order of evaluation may be chosen differently for * each procedure call. * - * Note: In many dialects of Lisp, the empty list, (), is a legitimate + * NOTE: In many dialects of Lisp, the empty list, (), is a legitimate * expression evaluating to itself. In Scheme, it is an error. * * ------------------------------------------------------------------ */ @@ -519,7 +519,7 @@ inline namespace kernel * difference between the two is that include-ci reads each file as if it * began with the #!fold-case directive, while include does not. * - * Note: Implementations are encouraged to search for files in the + * NOTE: Implementations are encouraged to search for files in the * directory which contains the including file, and to provide a way for * users to specify other directories to search. * @@ -997,7 +997,7 @@ inline namespace kernel } else if (expression.is()) { - if (let const& identity = std::as_const(*this).identify(expression, bound_variables, free_variables); is_truthy(identity)) // The syntactic-closure is an alias + if (let const& identity = std::as_const(*this).identify(expression, bound_variables, free_variables); identity != f) // The syntactic-closure is an alias { return syntax::reference(*this, expression, bound_variables, free_variables, continuation, tail); } @@ -1115,7 +1115,7 @@ inline namespace kernel { return f; } - else if (let const& x = assq(variable, free_variables); is_truthy(x)) + else if (let const& x = assq(variable, free_variables); x != f) { return cdr(x).as()(bound_variables); } @@ -1169,7 +1169,7 @@ inline namespace kernel { return f; } - else if (let const& identity = std::as_const(*this).identify(variable, bound_variables, free_variables); is_truthy(identity)) + else if (let const& identity = std::as_const(*this).identify(variable, bound_variables, free_variables); identity != f) { return identity; } diff --git a/src/kernel/boolean.cpp b/src/kernel/boolean.cpp index 210edafa4..b5493203d 100644 --- a/src/kernel/boolean.cpp +++ b/src/kernel/boolean.cpp @@ -22,11 +22,7 @@ namespace meevax inline namespace kernel { let const t = make(true); - let const f = make(false); - auto is_truthy(object const& x) -> bool - { - return not eq(x, f); - } + let const f = make(false); } // namespace kernel } // namespace meevax diff --git a/src/kernel/boot.cpp b/src/kernel/boot.cpp index b1b7386b7..0dd39c821 100644 --- a/src/kernel/boot.cpp +++ b/src/kernel/boot.cpp @@ -48,7 +48,7 @@ inline namespace kernel library.define("not", [](let const& xs) { - return not is_truthy(xs[0]); + return xs[0] == f; }); }); @@ -283,7 +283,7 @@ inline namespace kernel } else if (let const& status = car(xs); status.is()) { - throw is_truthy(status) ? EXIT_SUCCESS : EXIT_FAILURE; + throw status != f ? EXIT_SUCCESS : EXIT_FAILURE; } else { diff --git a/src/kernel/environment.cpp b/src/kernel/environment.cpp index b33dcf7d4..725d1df09 100644 --- a/src/kernel/environment.cpp +++ b/src/kernel/environment.cpp @@ -119,7 +119,7 @@ inline namespace kernel return filter([&](let const& identity) { assert(identity.is()); - return is_truthy(memq(car(identity), identities)); + return memq(car(identity), identities) != f; }, resolve(import_set)); }; @@ -141,7 +141,7 @@ inline namespace kernel return filter([&](let const& identity) { assert(identity.is()); - return not is_truthy(memq(car(identity), identities)); + return memq(car(identity), identities) == f; }, resolve(import_set)); }; @@ -189,7 +189,7 @@ inline namespace kernel assert(identity.is()); assert(car(identity).is_also()); - if (let const& renaming = assq(car(identity), renamings); is_truthy(renaming)) + if (let const& renaming = assq(car(identity), renamings); renaming != f) { assert(cadr(renaming).is()); return make(cadr(renaming), cdr(identity)); diff --git a/src/kernel/implementation_dependent.cpp b/src/kernel/implementation_dependent.cpp index b48ee114b..421e54113 100644 --- a/src/kernel/implementation_dependent.cpp +++ b/src/kernel/implementation_dependent.cpp @@ -48,7 +48,7 @@ inline namespace kernel } else { - return eq(requirement, make_symbol("else")) or is_truthy(memq(requirement, features())); + return requirement == make_symbol("else") or memq(requirement, features()) != f; } }