diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 33c66abd9..50915f941 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ jobs: matrix: compiler: [ g++, clang++ ] configuration: [ Debug, Release ] - system: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-14 ] + system: [ ubuntu-22.04, ubuntu-24.04, macos-14 ] steps: - uses: actions/checkout@v3 - run: ./script/setup-${{ matrix.system }}.sh --all diff --git a/CMakeLists.txt b/CMakeLists.txt index 21e925a22..54f8b3e49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16.3) # Ubuntu 20.04 LTS default +cmake_minimum_required(VERSION 3.22.1) # Ubuntu 22.04 LTS default execute_process( COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/VERSION @@ -25,7 +25,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-Og -gdwarf-4") # NOTE: The `-gdwarf-4` option is set set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto -DNDEBUG ${${PROJECT_NAME}_RELEASE_PLUS}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -gdwarf-4") -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -38,16 +38,6 @@ endif() # ---- CONFIGURE --------------------------------------------------------------- -include(TestBigEndian) - -TEST_BIG_ENDIAN(IS_BIG_ENDIAN) # Use CMAKE_CXX_BYTE_ORDER if CMake >= 3.20 - -if(${IS_BIG_ENDIAN}) - set(${PROJECT_NAME}_BYTE_ORDER "big-endian") -else() - set(${PROJECT_NAME}_BYTE_ORDER "little-endian") -endif() - execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --digit-value OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DIGIT_VALUE) execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --downcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DOWNCASE) execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --property OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_PROPERTY) diff --git a/README.md b/README.md index f3574e6c4..56f000b31 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,8 @@ Procedures for each standard are provided by the following R7RS-style libraries: ### Requirements -- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0) -- [CMake](https://cmake.org/) (>= 3.16.3) +- [GCC](https://gcc.gnu.org/) (>= 11.4.0) or [Clang](https://clang.llvm.org/) (>= 14.0.0) +- [CMake](https://cmake.org/) (>= 3.22.1) - [GNU Make](http://savannah.gnu.org/projects/make) - [GNU Binutils](https://www.gnu.org/software/binutils/) - [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/) @@ -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.262_amd64.deb +sudo apt install build/meevax_0.5.270_amd64.deb ``` or @@ -122,9 +122,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.262.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.5.270.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.262_amd64.deb` +| `package` | Generate debian package `meevax_0.5.270_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 2e253c798..0f0c249a9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.262 +0.5.270 diff --git a/configure/README.md b/configure/README.md index 4cbe1337d..0e5e51df4 100644 --- a/configure/README.md +++ b/configure/README.md @@ -78,7 +78,7 @@ Procedures for each standard are provided by the following R7RS-style libraries: ### Requirements -- [GCC](https://gcc.gnu.org/) (>= 9.4.0) or [Clang](https://clang.llvm.org/) (>= 11.0.0) +- [GCC](https://gcc.gnu.org/) (>= 11.4.0) or [Clang](https://clang.llvm.org/) (>= 14.0.0) - [CMake](https://cmake.org/) (>= ${CMAKE_MINIMUM_REQUIRED_VERSION}) - [GNU Make](http://savannah.gnu.org/projects/make) - [GNU Binutils](https://www.gnu.org/software/binutils/) diff --git a/configure/version.cpp b/configure/version.cpp index 732ec34ab..e2b0b23f2 100644 --- a/configure/version.cpp +++ b/configure/version.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto help() noexcept -> std::string_view { @@ -39,7 +37,7 @@ inline namespace kernel make_symbol("${${PROJECT_NAME}_SYSTEM_NAME}"), make_symbol("${CMAKE_SYSTEM_PROCESSOR}"), make_symbol(memory::model::name()), - make_symbol("${${PROJECT_NAME}_BYTE_ORDER}"), + make_symbol(std::endian::native == std::endian::little ? "little-endian" : "big-endian"), make_symbol("${PROJECT_NAME}"), make_symbol("${PROJECT_NAME}-${PROJECT_VERSION}")); @@ -51,5 +49,4 @@ inline namespace kernel let static const version = make_symbol("${PROJECT_VERSION}"); return version; } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 124b00a83..c8c989f22 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,8 +1,8 @@ -cmake_minimum_required(VERSION 3.16.3) # Ubuntu 20.04 LTS default +cmake_minimum_required(VERSION 3.22.1) # Ubuntu 22.04 LTS default project(example VERSION 0.0.0 LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) find_package(Meevax REQUIRED) # NOTE: case-insensitive diff --git a/include/meevax/bit/bit_cast.hpp b/include/meevax/bit/bit_cast.hpp deleted file mode 100644 index 09f16f66d..000000000 --- a/include/meevax/bit/bit_cast.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2018-2024 Tatsuya Yamasaki. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef INCLUDED_MEEVAX_BIT_BIT_CAST_HPP -#define INCLUDED_MEEVAX_BIT_BIT_CAST_HPP - -#include -#include - -namespace meevax -{ -inline namespace bit -{ - template , - std::is_trivially_copyable, - std::is_trivially_copyable, - std::is_trivially_constructible>>> - auto bit_cast(From const& from) noexcept - { - To to; - std::memcpy(&to, &from, sizeof from); - return to; - } -} // namespace bit -} // namespace meevax - -#endif // INCLUDED_MEEVAX_BIT_BIT_CAST_HPP diff --git a/include/meevax/bit/log2.hpp b/include/meevax/bit/log2.hpp deleted file mode 100644 index c6de7be60..000000000 --- a/include/meevax/bit/log2.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2018-2024 Tatsuya Yamasaki. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef INCLUDED_MEEVAX_BIT_LOG2_HPP -#define INCLUDED_MEEVAX_BIT_LOG2_HPP - -namespace meevax -{ -inline namespace bit -{ - template - constexpr auto log2(T x) noexcept -> T - { - return (x < 2) ? 1 : log2(x / 2) + 1; - } - - static_assert(log2(0b0001) == 1); - static_assert(log2(0b0010) == 2); - static_assert(log2(0b0011) == 2); - static_assert(log2(0b0100) == 3); - static_assert(log2(0b0101) == 3); - static_assert(log2(0b0110) == 3); - static_assert(log2(0b0111) == 3); - static_assert(log2(0b1000) == 4); -} // namespace bit -} // namespace meevax - -#endif // INCLUDED_MEEVAX_BIT_LOG2_HPP diff --git a/include/meevax/bitset/simple_bitset.hpp b/include/meevax/bitset/simple_bitset.hpp index 9ea4f7aab..db469ec6a 100644 --- a/include/meevax/bitset/simple_bitset.hpp +++ b/include/meevax/bitset/simple_bitset.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace bitset +namespace meevax::inline bitset { template struct simple_bitset : public std::array @@ -46,7 +44,6 @@ inline namespace bitset return (*this)[i]; } }; -} // namespace bitset -} // namespace meevax +} // namespace meevax::bitset #endif // INCLUDED_MEEVAX_BITSET_SIMPLE_BITSET_HPP diff --git a/include/meevax/chrono/duration.hpp b/include/meevax/chrono/duration.hpp index 4b3999961..2856fcd0f 100644 --- a/include/meevax/chrono/duration.hpp +++ b/include/meevax/chrono/duration.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace chrono +namespace meevax::inline chrono { using days = std::chrono::duration, std::chrono::hours::period>>; @@ -39,7 +37,6 @@ inline namespace chrono } auto operator <<(std::ostream &, std::chrono::nanoseconds) -> std::ostream &; -} // namespace chrono -} // namespace meevax +} // namespace meevax::chrono #endif // INCLUDED_MEEVAX_CHRONO_DURATION_HPP diff --git a/include/meevax/functional/combinator.hpp b/include/meevax/functional/combinator.hpp index 9aeec4f31..f2e4c9867 100644 --- a/include/meevax/functional/combinator.hpp +++ b/include/meevax/functional/combinator.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace functional +namespace meevax::inline functional { inline auto i = [](auto&& x) constexpr { @@ -41,7 +39,6 @@ inline namespace functional return curry(std::forward(f)) (std::forward(f)); }; -} // namespace functional -} // namespace meevax +} // namespace meevax::functional #endif // INCLUDED_MEEVAX_FUNCTIONAL_COMBINATOR_HPP diff --git a/include/meevax/functional/compose.hpp b/include/meevax/functional/compose.hpp index ada1c2c94..7f3385428 100644 --- a/include/meevax/functional/compose.hpp +++ b/include/meevax/functional/compose.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace functional +namespace meevax::inline functional { inline auto compose = [](auto&& f, auto&& g) constexpr { @@ -31,7 +29,6 @@ inline namespace functional return std::get<0>(fs)(std::get<1>(fs)(std::forward(xs)...)); }; }; -} // namespace functional -} // namespace meevax +} // namespace meevax::functional #endif // INCLUDED_MEEVAX_FUNCTIONAL_COMPOSE_HPP diff --git a/include/meevax/functional/curry.hpp b/include/meevax/functional/curry.hpp index b659549ca..6f67e1696 100644 --- a/include/meevax/functional/curry.hpp +++ b/include/meevax/functional/curry.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace functional +namespace meevax::inline functional { template constexpr auto curry(F&& f) -> decltype(auto) @@ -39,7 +37,6 @@ inline namespace functional }; }; } -} // namespace functional -} // namespace meevax +} // namespace meevax::functional #endif // INCLUDED_MEEVAX_FUNCTIONAL_CURRY_HPP diff --git a/include/meevax/iostream/escape_sequence.hpp b/include/meevax/iostream/escape_sequence.hpp index 0c09990a3..73745b843 100644 --- a/include/meevax/iostream/escape_sequence.hpp +++ b/include/meevax/iostream/escape_sequence.hpp @@ -22,9 +22,7 @@ #include #include -namespace meevax -{ -inline namespace iostream +namespace meevax::inline iostream { template struct escape_sequence @@ -110,7 +108,6 @@ inline namespace iostream } #undef DEFINE -} // namespace iostream -} // namespace meevax +} // namespace meevax::iostream #endif // INCLUDED_MEEVAX_IOSTREAM_ESCAPE_SEQUENCE_HPP diff --git a/include/meevax/iostream/is_console.hpp b/include/meevax/iostream/is_console.hpp index 31e1a4d18..656c42098 100644 --- a/include/meevax/iostream/is_console.hpp +++ b/include/meevax/iostream/is_console.hpp @@ -21,9 +21,7 @@ #include -namespace meevax -{ -inline namespace iostream +namespace meevax::inline iostream { inline auto is_console = [](std::ostream & os) { @@ -42,7 +40,6 @@ inline namespace iostream return false; } }; -} // namespace iostream -} // namespace meevax +} // namespace meevax::iostream #endif // INCLUDED_MEEVAX_IOSTREAM_IS_CONSOLE_HPP diff --git a/include/meevax/iostream/lexical_cast.hpp b/include/meevax/iostream/lexical_cast.hpp index d59ada057..f4d555153 100644 --- a/include/meevax/iostream/lexical_cast.hpp +++ b/include/meevax/iostream/lexical_cast.hpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace iostream +namespace meevax::inline iostream { template auto lexical_cast(Ts&&... xs) -> To @@ -55,7 +53,6 @@ inline namespace iostream throw std::runtime_error(what.str()); } } -} // namespace iostream -} // namespace meevax +} // namespace meevax::iostream #endif // INCLUDED_MEEVAX_IOSTREAM_LEXICAL_CAST_HPP diff --git a/include/meevax/iterator/index_iterator.hpp b/include/meevax/iterator/index_iterator.hpp index b75bb3bbc..0e990e328 100644 --- a/include/meevax/iterator/index_iterator.hpp +++ b/include/meevax/iterator/index_iterator.hpp @@ -23,9 +23,7 @@ #include #include -namespace meevax -{ -inline namespace iterator +namespace meevax::inline iterator { template struct index_iterator @@ -111,7 +109,6 @@ inline namespace iterator return not (a == b); } }; -} // namespace iterator -} // namespace meevax +} // namespace meevax::iterator #endif // INCLUDED_MEEVAX_ITERATOR_INDEX_ITERATOR_HPP diff --git a/include/meevax/kernel/binary_input_file_port.hpp b/include/meevax/kernel/binary_input_file_port.hpp index c24896966..c7779d618 100644 --- a/include/meevax/kernel/binary_input_file_port.hpp +++ b/include/meevax/kernel/binary_input_file_port.hpp @@ -22,9 +22,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct binary_input_file_port : public binary_input_port { @@ -52,7 +50,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, binary_input_file_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BINARY_INPUT_FILE_PORT_HPP diff --git a/include/meevax/kernel/binary_input_port.hpp b/include/meevax/kernel/binary_input_port.hpp index 07c1a27ef..3ce8ef3dd 100644 --- a/include/meevax/kernel/binary_input_port.hpp +++ b/include/meevax/kernel/binary_input_port.hpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct binary_input_port : public virtual binary_port, public virtual input_port { @@ -35,7 +33,6 @@ inline namespace kernel virtual auto peek() -> object = 0; }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BINARY_INPUT_PORT_HPP diff --git a/include/meevax/kernel/binary_output_file_port.hpp b/include/meevax/kernel/binary_output_file_port.hpp index 89359b3f5..2b97819cb 100644 --- a/include/meevax/kernel/binary_output_file_port.hpp +++ b/include/meevax/kernel/binary_output_file_port.hpp @@ -22,9 +22,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct binary_output_file_port : public binary_output_port { @@ -50,7 +48,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, binary_output_file_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BINARY_OUTPUT_FILE_PORT_HPP diff --git a/include/meevax/kernel/binary_output_port.hpp b/include/meevax/kernel/binary_output_port.hpp index 475bc4303..aae143952 100644 --- a/include/meevax/kernel/binary_output_port.hpp +++ b/include/meevax/kernel/binary_output_port.hpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct binary_output_port : public virtual binary_port, public virtual output_port { @@ -31,7 +29,6 @@ inline namespace kernel virtual auto put(u8vector const&) -> void = 0; }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BINARY_OUTPUT_PORT_HPP diff --git a/include/meevax/kernel/binary_port.hpp b/include/meevax/kernel/binary_port.hpp index 9665a205a..779728a8c 100644 --- a/include/meevax/kernel/binary_port.hpp +++ b/include/meevax/kernel/binary_port.hpp @@ -19,13 +19,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct binary_port : public virtual port {}; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BINARY_PORT_HPP diff --git a/include/meevax/kernel/boolean.hpp b/include/meevax/kernel/boolean.hpp index 74db373a7..6d7e216da 100644 --- a/include/meevax/kernel/boolean.hpp +++ b/include/meevax/kernel/boolean.hpp @@ -19,14 +19,11 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { let extern const t; let extern const f; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BOOLEAN_HPP diff --git a/include/meevax/kernel/boot.hpp b/include/meevax/kernel/boot.hpp index d7eaa7781..5606aff7c 100644 --- a/include/meevax/kernel/boot.hpp +++ b/include/meevax/kernel/boot.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto boot() -> void; @@ -37,7 +35,6 @@ inline namespace kernel } } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BOOT_HPP diff --git a/include/meevax/kernel/box.hpp b/include/meevax/kernel/box.hpp index 92bcdc4fc..4a64d181b 100644 --- a/include/meevax/kernel/box.hpp +++ b/include/meevax/kernel/box.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct box : public virtual pair // (value . null) { @@ -29,7 +27,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, box const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_BOX_HPP diff --git a/include/meevax/kernel/character.hpp b/include/meevax/kernel/character.hpp index 7ab3721a7..df247632b 100644 --- a/include/meevax/kernel/character.hpp +++ b/include/meevax/kernel/character.hpp @@ -22,9 +22,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct character { @@ -212,7 +210,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, character const&) -> std::ostream &; // write -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_CHARACTER_HPP diff --git a/include/meevax/kernel/closure.hpp b/include/meevax/kernel/closure.hpp index 1fc2bec9d..f6e2af977 100644 --- a/include/meevax/kernel/closure.hpp +++ b/include/meevax/kernel/closure.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct closure : public virtual pair { @@ -29,7 +27,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, closure const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_CLOSURE_HPP diff --git a/include/meevax/kernel/comparator.hpp b/include/meevax/kernel/comparator.hpp index 314696b73..66c943ae4 100644 --- a/include/meevax/kernel/comparator.hpp +++ b/include/meevax/kernel/comparator.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { inline auto eq = [](auto const& x, auto const& y) constexpr { @@ -34,7 +32,6 @@ inline namespace kernel }; auto equal(object const&, object const&) -> bool; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_COMPARATOR_HPP diff --git a/include/meevax/kernel/complex.hpp b/include/meevax/kernel/complex.hpp index e3417550f..a1cb81349 100644 --- a/include/meevax/kernel/complex.hpp +++ b/include/meevax/kernel/complex.hpp @@ -21,9 +21,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct complex : public virtual pair // ( . ) { @@ -49,7 +47,6 @@ inline namespace kernel auto magnitude(object const&) -> object; auto angle(object const&) -> object; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_COMPLEX_HPP diff --git a/include/meevax/kernel/conditional_expand.hpp b/include/meevax/kernel/conditional_expand.hpp index b213e0e55..fc3f7cdc5 100644 --- a/include/meevax/kernel/conditional_expand.hpp +++ b/include/meevax/kernel/conditional_expand.hpp @@ -19,12 +19,9 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto conditional_expand(object const&) -> object; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_CONDITIONAL_EXPAND_HPP diff --git a/include/meevax/kernel/configurator.hpp b/include/meevax/kernel/configurator.hpp index 7d83317e2..4df2625cf 100644 --- a/include/meevax/kernel/configurator.hpp +++ b/include/meevax/kernel/configurator.hpp @@ -24,9 +24,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { template struct configurator @@ -158,7 +156,6 @@ inline namespace kernel } } }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_CONFIGURATOR_HPP diff --git a/include/meevax/kernel/continuation.hpp b/include/meevax/kernel/continuation.hpp index 2a5762c10..e487807e8 100644 --- a/include/meevax/kernel/continuation.hpp +++ b/include/meevax/kernel/continuation.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct continuation : public virtual pair { @@ -29,7 +27,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, continuation const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_CONTINUATION_HPP diff --git a/include/meevax/kernel/describable.hpp b/include/meevax/kernel/describable.hpp index 51ff4a923..f56d8d4dd 100644 --- a/include/meevax/kernel/describable.hpp +++ b/include/meevax/kernel/describable.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct describable { @@ -32,7 +30,6 @@ inline namespace kernel : name { std::forward(xs)... } {} }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_DESCRIBABLE_HPP diff --git a/include/meevax/kernel/dynamic_environment.hpp b/include/meevax/kernel/dynamic_environment.hpp index ce7018e20..2bd741a3b 100644 --- a/include/meevax/kernel/dynamic_environment.hpp +++ b/include/meevax/kernel/dynamic_environment.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct dynamic_environment { @@ -83,7 +81,6 @@ inline namespace kernel auto run() -> object; }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_DYNAMIC_ENVIRONMENT_HPP diff --git a/include/meevax/kernel/environment.hpp b/include/meevax/kernel/environment.hpp index 47623bee3..b95aa5654 100644 --- a/include/meevax/kernel/environment.hpp +++ b/include/meevax/kernel/environment.hpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct environment : public configurator , public dynamic_environment @@ -43,7 +41,6 @@ inline namespace kernel extern template struct configurator; extern template struct syntactic_environment; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_ENVIRONMENT_HPP diff --git a/include/meevax/kernel/eof.hpp b/include/meevax/kernel/eof.hpp index 76e17f29f..c77edda93 100644 --- a/include/meevax/kernel/eof.hpp +++ b/include/meevax/kernel/eof.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct eof {}; @@ -29,7 +27,6 @@ inline namespace kernel let extern const eof_object; auto operator <<(std::ostream &, eof const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_EOF_HPP diff --git a/include/meevax/kernel/error.hpp b/include/meevax/kernel/error.hpp index e4f0822f8..c9e1c2398 100644 --- a/include/meevax/kernel/error.hpp +++ b/include/meevax/kernel/error.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct error : public virtual pair // ( . ) , public std::exception @@ -120,7 +118,6 @@ inline namespace kernel return EXIT_FAILURE; } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_ERROR_HPP diff --git a/include/meevax/kernel/exact_integer.hpp b/include/meevax/kernel/exact_integer.hpp index d56431ffa..2f989d0ae 100644 --- a/include/meevax/kernel/exact_integer.hpp +++ b/include/meevax/kernel/exact_integer.hpp @@ -19,11 +19,11 @@ #include +#include // std::strlen + #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct exact_integer { @@ -129,7 +129,6 @@ inline namespace kernel }; let extern const e0, e1; // Frequently used exact-integer values. -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_EXACT_INTEGER_HPP diff --git a/include/meevax/kernel/ghost.hpp b/include/meevax/kernel/ghost.hpp index ead7c2b4f..d7607b099 100644 --- a/include/meevax/kernel/ghost.hpp +++ b/include/meevax/kernel/ghost.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct ghost { @@ -33,7 +31,6 @@ inline namespace kernel let extern const unspecified; let extern const undefined; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_GHOST_HPP diff --git a/include/meevax/kernel/homogeneous_vector.hpp b/include/meevax/kernel/homogeneous_vector.hpp index 611d0e78a..2ffc676c6 100644 --- a/include/meevax/kernel/homogeneous_vector.hpp +++ b/include/meevax/kernel/homogeneous_vector.hpp @@ -23,9 +23,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { template struct homogeneous_vector : private std::valarray @@ -123,7 +121,6 @@ inline namespace kernel using f32vector = homogeneous_vector; using f64vector = homogeneous_vector; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_HOMOGENEOUS_VECTOR_HPP diff --git a/include/meevax/kernel/identifier.hpp b/include/meevax/kernel/identifier.hpp index de36684f2..23eb63472 100644 --- a/include/meevax/kernel/identifier.hpp +++ b/include/meevax/kernel/identifier.hpp @@ -17,13 +17,10 @@ #ifndef INCLUDED_MEEVAX_KERNEL_IDENTIFIER_HPP #define INCLUDED_MEEVAX_KERNEL_IDENTIFIER_HPP -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct identifier {}; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_IDENTIFIER_HPP diff --git a/include/meevax/kernel/identity.hpp b/include/meevax/kernel/identity.hpp index eb144eaf4..ba4d23a82 100644 --- a/include/meevax/kernel/identity.hpp +++ b/include/meevax/kernel/identity.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct absolute : public virtual pair // ( . ) { @@ -49,7 +47,6 @@ inline namespace kernel { return false; // for free-identifier=? } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_IDENTITY_HPP diff --git a/include/meevax/kernel/include.hpp b/include/meevax/kernel/include.hpp index e0383d66c..0afdb9ad7 100644 --- a/include/meevax/kernel/include.hpp +++ b/include/meevax/kernel/include.hpp @@ -19,12 +19,9 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto include(object const&, bool = true, object const& = nullptr) -> object; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_INCLUDE_HPP diff --git a/include/meevax/kernel/input_file_port.hpp b/include/meevax/kernel/input_file_port.hpp index 3150daed4..0526b03a9 100644 --- a/include/meevax/kernel/input_file_port.hpp +++ b/include/meevax/kernel/input_file_port.hpp @@ -21,9 +21,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct input_file_port : public textual_input_port { @@ -49,7 +47,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, input_file_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_INPUT_FILE_PORT_HPP diff --git a/include/meevax/kernel/input_homogeneous_vector_port.hpp b/include/meevax/kernel/input_homogeneous_vector_port.hpp index 994540a20..99f0a0705 100644 --- a/include/meevax/kernel/input_homogeneous_vector_port.hpp +++ b/include/meevax/kernel/input_homogeneous_vector_port.hpp @@ -23,9 +23,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { template struct input_homogeneous_vector_port : public binary_input_port @@ -98,7 +96,6 @@ inline namespace kernel } using input_u8vector_port = input_homogeneous_vector_port; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_INPUT_HOMOGENEOUS_VECTOR_PORT_HPP diff --git a/include/meevax/kernel/input_port.hpp b/include/meevax/kernel/input_port.hpp index e6ffd6ea7..1e1bc8ee4 100644 --- a/include/meevax/kernel/input_port.hpp +++ b/include/meevax/kernel/input_port.hpp @@ -19,13 +19,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct input_port : public virtual port {}; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_INPUT_PORT_HPP diff --git a/include/meevax/kernel/input_string_port.hpp b/include/meevax/kernel/input_string_port.hpp index 2cd6bd2cf..d97844ed6 100644 --- a/include/meevax/kernel/input_string_port.hpp +++ b/include/meevax/kernel/input_string_port.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct input_string_port : public textual_input_port { @@ -47,7 +45,6 @@ namespace literals { auto operator ""_r(char const*, std::size_t) -> object; } // namespace literals -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_INPUT_STRING_PORT_HPP diff --git a/include/meevax/kernel/instruction.hpp b/include/meevax/kernel/instruction.hpp index 6847c5df4..cdf3c3659 100644 --- a/include/meevax/kernel/instruction.hpp +++ b/include/meevax/kernel/instruction.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { enum class instruction { @@ -51,7 +49,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, instruction const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_INSTRUCTION_HPP diff --git a/include/meevax/kernel/interaction_environment.hpp b/include/meevax/kernel/interaction_environment.hpp index 4fc778b59..7da467b09 100644 --- a/include/meevax/kernel/interaction_environment.hpp +++ b/include/meevax/kernel/interaction_environment.hpp @@ -19,12 +19,9 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto interaction_environment() -> object const&; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_INTERACTION_ENVIRONMENT_HPP diff --git a/include/meevax/kernel/library.hpp b/include/meevax/kernel/library.hpp index 661e1285c..26380afa7 100644 --- a/include/meevax/kernel/library.hpp +++ b/include/meevax/kernel/library.hpp @@ -22,9 +22,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct library : public environment { @@ -76,7 +74,6 @@ inline namespace kernel return interaction_environment().as().define(name, std::forward(xs)...); } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_LIBRARY_HPP diff --git a/include/meevax/kernel/list.hpp b/include/meevax/kernel/list.hpp index cb8e768ed..2a92741a6 100644 --- a/include/meevax/kernel/list.hpp +++ b/include/meevax/kernel/list.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct from_list_tag { @@ -160,7 +158,6 @@ inline namespace kernel } auto longest_common_tail(let const&, let const&) -> object const&; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_LIST_HPP diff --git a/include/meevax/kernel/optimizer.hpp b/include/meevax/kernel/optimizer.hpp index 56a8066d4..8cc8d82cb 100644 --- a/include/meevax/kernel/optimizer.hpp +++ b/include/meevax/kernel/optimizer.hpp @@ -19,12 +19,9 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto optimize(object) -> object; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_OPTIMIZER_HPP diff --git a/include/meevax/kernel/output_file_port.hpp b/include/meevax/kernel/output_file_port.hpp index 95000450e..01a32d739 100644 --- a/include/meevax/kernel/output_file_port.hpp +++ b/include/meevax/kernel/output_file_port.hpp @@ -21,9 +21,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct output_file_port : public textual_output_port { @@ -45,7 +43,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, output_file_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_OUTPUT_FILE_PORT_HPP diff --git a/include/meevax/kernel/output_homogeneous_vector_port.hpp b/include/meevax/kernel/output_homogeneous_vector_port.hpp index 7f7ddf656..a5b0bf04e 100644 --- a/include/meevax/kernel/output_homogeneous_vector_port.hpp +++ b/include/meevax/kernel/output_homogeneous_vector_port.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { template struct output_homogeneous_vector_port : public binary_output_port @@ -60,7 +58,6 @@ inline namespace kernel } using output_u8vector_port = output_homogeneous_vector_port; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_OUTPUT_HOMOGENEOUS_VECTOR_PORT_HPP diff --git a/include/meevax/kernel/output_port.hpp b/include/meevax/kernel/output_port.hpp index 81f94ac88..da2bc6b72 100644 --- a/include/meevax/kernel/output_port.hpp +++ b/include/meevax/kernel/output_port.hpp @@ -19,15 +19,12 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct output_port : public virtual port { virtual auto flush() -> void = 0; }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_OUTPUT_PORT_HPP diff --git a/include/meevax/kernel/output_string_port.hpp b/include/meevax/kernel/output_string_port.hpp index 3dc93dea8..50a9812e7 100644 --- a/include/meevax/kernel/output_string_port.hpp +++ b/include/meevax/kernel/output_string_port.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct output_string_port : public textual_output_port { @@ -40,7 +38,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, output_string_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_OUTPUT_STRING_PORT_HPP diff --git a/include/meevax/kernel/port.hpp b/include/meevax/kernel/port.hpp index fb31a9669..95546f931 100644 --- a/include/meevax/kernel/port.hpp +++ b/include/meevax/kernel/port.hpp @@ -17,9 +17,7 @@ #ifndef INCLUDED_MEEVAX_KERNEL_PORT_HPP #define INCLUDED_MEEVAX_KERNEL_PORT_HPP -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct port { @@ -27,7 +25,6 @@ inline namespace kernel virtual auto is_open() const -> bool = 0; }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_PORT_HPP diff --git a/include/meevax/kernel/procedure.hpp b/include/meevax/kernel/procedure.hpp index 2e1cc458e..e46014aee 100644 --- a/include/meevax/kernel/procedure.hpp +++ b/include/meevax/kernel/procedure.hpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct primitive : public describable { @@ -149,7 +147,6 @@ inline namespace kernel template using procedure = procedure_traits; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_PROCEDURE_HPP diff --git a/include/meevax/kernel/ratio.hpp b/include/meevax/kernel/ratio.hpp index ef55b8bdc..fb1fe1b3b 100644 --- a/include/meevax/kernel/ratio.hpp +++ b/include/meevax/kernel/ratio.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct ratio { @@ -52,7 +50,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, ratio const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_RATIO_HPP diff --git a/include/meevax/kernel/standard_error_port.hpp b/include/meevax/kernel/standard_error_port.hpp index 2d39cb900..2434bb0d9 100644 --- a/include/meevax/kernel/standard_error_port.hpp +++ b/include/meevax/kernel/standard_error_port.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct standard_error_port : public textual_output_port { @@ -33,7 +31,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, standard_error_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_STANDARD_ERROR_PORT_HPP diff --git a/include/meevax/kernel/standard_input_port.hpp b/include/meevax/kernel/standard_input_port.hpp index 293fdb4b2..100a2b8b4 100644 --- a/include/meevax/kernel/standard_input_port.hpp +++ b/include/meevax/kernel/standard_input_port.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct standard_input_port : public textual_input_port { @@ -37,7 +35,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, standard_input_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_STANDARD_INPUT_PORT_HPP diff --git a/include/meevax/kernel/standard_output_port.hpp b/include/meevax/kernel/standard_output_port.hpp index ce2a775be..0de6ced36 100644 --- a/include/meevax/kernel/standard_output_port.hpp +++ b/include/meevax/kernel/standard_output_port.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct standard_output_port : public textual_output_port { @@ -33,7 +31,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, standard_output_port const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_STANDARD_OUTPUT_PORT_HPP diff --git a/include/meevax/kernel/string.hpp b/include/meevax/kernel/string.hpp index 10bd7bcc7..bf7c63bac 100644 --- a/include/meevax/kernel/string.hpp +++ b/include/meevax/kernel/string.hpp @@ -22,9 +22,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct string : private std::vector { @@ -50,15 +48,10 @@ inline namespace kernel operator std::string() const; - friend auto operator ==(string const& lhs, string const& rhs) { return static_cast const&>(lhs) == static_cast const&>(rhs); } - friend auto operator < (string const& lhs, string const& rhs) { return static_cast const&>(lhs) < static_cast const&>(rhs); } - friend auto operator > (string const& lhs, string const& rhs) { return static_cast const&>(lhs) > static_cast const&>(rhs); } - friend auto operator <=(string const& lhs, string const& rhs) { return static_cast const&>(lhs) <= static_cast const&>(rhs); } - friend auto operator >=(string const& lhs, string const& rhs) { return static_cast const&>(lhs) >= static_cast const&>(rhs); } + auto operator <=>(string const&) const = default; }; auto operator <<(std::ostream &, string const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_STRING_HPP diff --git a/include/meevax/kernel/symbol.hpp b/include/meevax/kernel/symbol.hpp index 58143de71..9ee60f0dd 100644 --- a/include/meevax/kernel/symbol.hpp +++ b/include/meevax/kernel/symbol.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct symbol : public identifier { @@ -33,6 +31,8 @@ inline namespace kernel : name { std::forward(xs)... } {} + auto operator <=>(symbol const&) const = default; + operator std::string() const noexcept { return name; @@ -40,12 +40,6 @@ inline namespace kernel }; auto operator + (symbol const&, symbol const&) -> std::string; - auto operator ==(symbol const&, symbol const&) -> bool; - auto operator !=(symbol const&, symbol const&) -> bool; - auto operator < (symbol const&, symbol const&) -> bool; - auto operator <=(symbol const&, symbol const&) -> bool; - auto operator > (symbol const&, symbol const&) -> bool; - auto operator >=(symbol const&, symbol const&) -> bool; auto operator <<(std::ostream &, symbol const&) -> std::ostream &; @@ -58,7 +52,6 @@ inline namespace kernel auto symbols() -> std::unordered_map &; auto make_symbol(std::string const&) -> object const&; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_SYMBOL_HPP diff --git a/include/meevax/kernel/syntactic_environment.hpp b/include/meevax/kernel/syntactic_environment.hpp index 6d1687ba5..ff844d2dc 100644 --- a/include/meevax/kernel/syntactic_environment.hpp +++ b/include/meevax/kernel/syntactic_environment.hpp @@ -24,9 +24,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { template struct syntactic_environment : public virtual pair // ( . ) @@ -1149,7 +1147,6 @@ inline namespace kernel return xs; } }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_SYNTACTIC_ENVIRONMENT_HPP diff --git a/include/meevax/kernel/textual_input_port.hpp b/include/meevax/kernel/textual_input_port.hpp index 7cbb75df9..eb6d0f314 100644 --- a/include/meevax/kernel/textual_input_port.hpp +++ b/include/meevax/kernel/textual_input_port.hpp @@ -25,9 +25,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct textual_input_port : public virtual textual_port, public virtual input_port { @@ -210,7 +208,6 @@ inline namespace kernel '|', // 0x7C '}'); // 0x7D } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_TEXTUAL_INPUT_PORT_HPP diff --git a/include/meevax/kernel/textual_output_port.hpp b/include/meevax/kernel/textual_output_port.hpp index f8b54c596..173965c76 100644 --- a/include/meevax/kernel/textual_output_port.hpp +++ b/include/meevax/kernel/textual_output_port.hpp @@ -22,9 +22,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct textual_output_port : public virtual textual_port, public virtual output_port { @@ -40,7 +38,6 @@ inline namespace kernel explicit virtual operator std::ostream &() = 0; }; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_TEXTUAL_OUTPUT_PORT_HPP diff --git a/include/meevax/kernel/textual_port.hpp b/include/meevax/kernel/textual_port.hpp index 522e392e6..3cbcafd6c 100644 --- a/include/meevax/kernel/textual_port.hpp +++ b/include/meevax/kernel/textual_port.hpp @@ -19,13 +19,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct textual_port : public virtual port {}; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_TEXTUAL_PORT_HPP diff --git a/include/meevax/kernel/transformer.hpp b/include/meevax/kernel/transformer.hpp index 580f709bc..7b07d4bf4 100644 --- a/include/meevax/kernel/transformer.hpp +++ b/include/meevax/kernel/transformer.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct transformer : public virtual pair // ( . ) { @@ -29,7 +27,6 @@ inline namespace kernel }; auto operator <<(std::ostream &, transformer const&) -> std::ostream &; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_TRANSFORMER_HPP diff --git a/include/meevax/kernel/vector.hpp b/include/meevax/kernel/vector.hpp index e2cd5b02b..5a0c0b65d 100644 --- a/include/meevax/kernel/vector.hpp +++ b/include/meevax/kernel/vector.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct heterogeneous_vector : private std::vector { @@ -46,7 +44,6 @@ inline namespace kernel using vector = heterogeneous_vector; auto make_vector(object const&) -> object; // list->vector -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_VECTOR_HPP diff --git a/include/meevax/kernel/version.hpp b/include/meevax/kernel/version.hpp index 59fa108c1..e1a5748bb 100644 --- a/include/meevax/kernel/version.hpp +++ b/include/meevax/kernel/version.hpp @@ -22,16 +22,13 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto help() noexcept -> std::string_view; auto features() -> object const&; auto version() -> object const&; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_KERNEL_VERSION_HPP diff --git a/include/meevax/map/simple_flat_map.hpp b/include/meevax/map/simple_flat_map.hpp index b833cf7c3..1c0e70682 100644 --- a/include/meevax/map/simple_flat_map.hpp +++ b/include/meevax/map/simple_flat_map.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace map +namespace meevax::inline map { template struct simple_flat_map : public std::vector> @@ -43,7 +41,6 @@ inline namespace map return this->emplace(std::forward(xs)...); } }; -} // namespace map -} // namespace meevax +} // namespace meevax::map #endif // INCLUDED_MEEVAX_MAP_SIMPLE_FLAT_MAP_HPP diff --git a/include/meevax/memory/allocator.hpp b/include/meevax/memory/allocator.hpp index 6f6be4070..b8498699e 100644 --- a/include/meevax/memory/allocator.hpp +++ b/include/meevax/memory/allocator.hpp @@ -22,9 +22,7 @@ #include #include // std::exchange -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { /* Simple Segregated Storage Allocator @@ -123,7 +121,6 @@ class allocator free_list = reinterpret_cast(p); } }; -} // namespace memory -} // namespace meevax +} // namespace meevax::memory #endif // INCLUDED_MEEVAX_MEMORY_ALLOCATOR_HPP diff --git a/include/meevax/memory/collector.hpp b/include/meevax/memory/collector.hpp index cb5166106..dd22328b4 100644 --- a/include/meevax/memory/collector.hpp +++ b/include/meevax/memory/collector.hpp @@ -32,9 +32,7 @@ #include #include -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { using view = std::pair; // TODO Adapt to C++20's std::range concept @@ -409,7 +407,9 @@ inline namespace memory 0x0000'0000'0000'0000 ~ 0x7FFF'FFFF'FFFF'FFFF */ template - using pointer_set = integer_set; + using pointer_set = integer_set; private: static inline pointer_set objects {}; @@ -612,7 +612,6 @@ inline namespace memory objects.swap(reachables); } }; -} // namespace memory -} // namespace meevax +} // namespace meevax::memory #endif // INCLUDED_MEEVAX_MEMORY_COLLECTOR_HPP diff --git a/include/meevax/memory/integer_set.hpp b/include/meevax/memory/integer_set.hpp index b1df88069..6312f991f 100644 --- a/include/meevax/memory/integer_set.hpp +++ b/include/meevax/memory/integer_set.hpp @@ -18,21 +18,17 @@ #define INCLUDED_MEEVAX_MEMORY_INTEGER_SET_HPP #include +#include #include #include // CHAR_BIT #include #include #include -#include -#include - -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { template - constexpr auto compressible_bitwidth_of = std::is_pointer_v ? log2(alignof(std::remove_pointer_t)) - 1 : 0; + constexpr auto compressible_bitwidth_of = std::is_pointer_v ? std::bit_width(alignof(std::remove_pointer_t)) - 1 : 0; constexpr auto operator ""_u64(unsigned long long int value) { @@ -345,7 +341,7 @@ inline namespace memory { if (auto datum = data[i] & (~0_u64 << index % 64); datum) { - index = i * 64 + __builtin_ctzl(datum); + index = i * 64 + std::countr_zero(datum); assert(data[index / 64] & (1_u64 << index % 64)); return; } @@ -353,7 +349,7 @@ inline namespace memory { if (auto datum = data[i]; datum) { - index = i * 64 + __builtin_ctzl(datum); + index = i * 64 + std::countr_zero(datum); assert(data[index / 64] & (1_u64 << index % 64)); return; } @@ -371,7 +367,7 @@ inline namespace memory { if (auto datum = data[i] & (~0_u64 >> (63 - index % 64)); datum) { - index = i * 64 + (63 - __builtin_clzl(datum)); + index = i * 64 + (63 - std::countl_zero(datum)); assert(data[index / 64] & (1_u64 << index % 64)); return; } @@ -379,7 +375,7 @@ inline namespace memory { if (auto datum = data[i]; datum) { - index = i * 64 + (63 - __builtin_clzl(datum)); + index = i * 64 + (63 - std::countl_zero(datum)); assert(data[index / 64] & (1_u64 << index % 64)); return; } @@ -480,7 +476,6 @@ inline namespace memory return const_iterator(this, reinterpret_cast(value)); } }; -} // namespace memory -} // namespace meevax +} // namespace meevax::memory #endif // INCLUDED_MEEVAX_MEMORY_INTEGER_SET_HPP diff --git a/include/meevax/memory/literal.hpp b/include/meevax/memory/literal.hpp index 7649bc4d5..34e41526b 100644 --- a/include/meevax/memory/literal.hpp +++ b/include/meevax/memory/literal.hpp @@ -17,9 +17,7 @@ #ifndef INCLUDED_MEEVAX_MEMORY_LITERAL_HPP #define INCLUDED_MEEVAX_MEMORY_LITERAL_HPP -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { constexpr auto operator ""_KiB(unsigned long long size) { @@ -30,7 +28,6 @@ inline namespace memory { return size * 1024 * 1024; } -} // namespace memory -} // namespace meevax +} // namespace meevax::memory #endif // INCLUDED_MEEVAX_MEMORY_LITERAL_HPP diff --git a/include/meevax/memory/model.hpp b/include/meevax/memory/model.hpp index 889c1e94e..d11120390 100644 --- a/include/meevax/memory/model.hpp +++ b/include/meevax/memory/model.hpp @@ -17,9 +17,7 @@ #ifndef INCLUDED_MEEVAX_MEMORY_MODEL_HPP #define INCLUDED_MEEVAX_MEMORY_MODEL_HPP -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { struct model { @@ -35,7 +33,6 @@ inline namespace memory static auto name() -> char const*; }; -} // namespace memory -} // namespace meevax +} // namespace meevax::memory #endif // INCLUDED_MEEVAX_MEMORY_MODEL_HPP diff --git a/include/meevax/memory/nan_boxing_pointer.hpp b/include/meevax/memory/nan_boxing_pointer.hpp index 28bcf04a3..5fbac3cab 100644 --- a/include/meevax/memory/nan_boxing_pointer.hpp +++ b/include/meevax/memory/nan_boxing_pointer.hpp @@ -17,18 +17,16 @@ #ifndef INCLUDED_MEEVAX_MEMORY_NAN_BOXING_POINTER_HPP #define INCLUDED_MEEVAX_MEMORY_NAN_BOXING_POINTER_HPP +#include #include #include #include #include #include -#include #include -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { static_assert(std::numeric_limits::is_iec559 and sizeof(double) == 8); @@ -76,12 +74,12 @@ inline namespace memory #define DEFINE(TYPE, ...) \ explicit nan_boxing_pointer(TYPE const& value __VA_ARGS__) noexcept \ - : data { reinterpret_cast(signature_##TYPE | bit_cast>(value)) } \ + : data { reinterpret_cast(signature_##TYPE | std::bit_cast>(value)) } \ {} \ \ auto reset(TYPE const& value __VA_ARGS__) noexcept -> void \ { \ - data = reinterpret_cast(signature_##TYPE | bit_cast>(value)); \ + data = reinterpret_cast(signature_##TYPE | std::bit_cast>(value)); \ } DEFINE(double, ) @@ -127,11 +125,11 @@ inline namespace memory { if constexpr (std::is_same_v, double>) { - return bit_cast(data); + return std::bit_cast(data); } else { - return bit_cast>(static_cast)>>(payload())); + return std::bit_cast>(static_cast)>>(payload())); } } @@ -253,8 +251,7 @@ inline namespace memory { return not x.compare(y); } -} // namespace memory -} // namespace meevax +} // namespace meevax::memory template struct std::hash> diff --git a/include/meevax/memory/pointer_set.hpp b/include/meevax/memory/pointer_set.hpp index 94ce4a2fe..a299a5dc9 100644 --- a/include/meevax/memory/pointer_set.hpp +++ b/include/meevax/memory/pointer_set.hpp @@ -27,15 +27,12 @@ #include #include -#include #include #include #include #include -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { inline namespace v1 { @@ -53,7 +50,7 @@ inline namespace v1 { std::uintptr_t const value; - static constexpr auto width = log2(alignof(std::remove_pointer_t)) - 1; + static constexpr auto width = std::bit_width(alignof(std::remove_pointer_t)) - 1; constexpr compact_pointer(Pointer p) : value { reinterpret_cast(p) >> width } @@ -296,7 +293,6 @@ namespace v2 struct pointer_set : integer_set {}; } // namespace v2 -} // namespace memory -} // namespace meevax +} // namespace meevax::memory #endif // INCLUDED_MEEVAX_MEMORY_POINTER_SET_HPP diff --git a/include/meevax/memory/simple_pointer.hpp b/include/meevax/memory/simple_pointer.hpp index 17862c7c4..b27d02182 100644 --- a/include/meevax/memory/simple_pointer.hpp +++ b/include/meevax/memory/simple_pointer.hpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { template struct simple_pointer @@ -78,8 +76,7 @@ inline namespace memory { return x.get() != y.get(); } -} // namespace memory -} // namespace meevax +} // namespace meevax::memory template struct std::hash> diff --git a/include/meevax/memory/tagged_pointer.hpp b/include/meevax/memory/tagged_pointer.hpp index af445ae8e..e174a75ec 100644 --- a/include/meevax/memory/tagged_pointer.hpp +++ b/include/meevax/memory/tagged_pointer.hpp @@ -17,15 +17,13 @@ #ifndef INCLUDED_MEEVAX_MEMORY_TAGGED_POINTER_HPP #define INCLUDED_MEEVAX_MEMORY_TAGGED_POINTER_HPP +#include #include -#include #include #include -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { template , @@ -41,14 +39,14 @@ inline namespace memory explicit constexpr tagged_pointer(T_##TAG const& value) \ : simple_pointer { \ reinterpret_cast( \ - static_cast(bit_cast>(value)) << 32 | TAG) } \ + static_cast(std::bit_cast>(value)) << 32 | TAG) } \ {} \ \ auto operator =(T_##TAG const& value) -> auto & \ { \ simple_pointer::data \ = reinterpret_cast( \ - static_cast(bit_cast>(value)) << 32 | TAG); \ + static_cast(std::bit_cast>(value)) << 32 | TAG); \ return *this; \ } \ \ @@ -87,7 +85,7 @@ inline namespace memory template auto as() const { - return bit_cast>( + return std::bit_cast>( static_cast)>>( reinterpret_cast(simple_pointer::data) >> 32)); } @@ -123,7 +121,6 @@ inline namespace memory } } }; -} // namespace memory -} // namespace meevax +} // namespace meevax::memory #endif // INCLUDED_MEEVAX_MEMORY_TAGGED_POINTER_HPP diff --git a/include/meevax/type_traits/integer.hpp b/include/meevax/type_traits/integer.hpp index cb7a83120..0513675ea 100644 --- a/include/meevax/type_traits/integer.hpp +++ b/include/meevax/type_traits/integer.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace type_traits +namespace meevax::inline type_traits { template struct int8n; @@ -83,7 +81,6 @@ inline namespace type_traits template using uint8n_t = typename uint8n::type; -} // namespace type_traits -} // namespace meevax +} // namespace meevax::type_traits #endif // INCLUDED_MEEVAX_TYPE_TRAITS_INTEGER_HPP diff --git a/include/meevax/type_traits/is_array_subscriptable.hpp b/include/meevax/type_traits/is_array_subscriptable.hpp index 0a2224da8..c608fda05 100644 --- a/include/meevax/type_traits/is_array_subscriptable.hpp +++ b/include/meevax/type_traits/is_array_subscriptable.hpp @@ -19,22 +19,22 @@ #include -namespace meevax -{ -inline namespace type_traits +namespace meevax::inline type_traits { template + [[deprecated]] struct is_array_subscriptable : public std::false_type {}; template + [[deprecated]] struct is_array_subscriptable()[std::declval()])>> : public std::true_type {}; template + [[deprecated]] inline constexpr auto is_array_subscriptable_v = is_array_subscriptable::value; -} // namespace type_traits -} // namespace meevax +} // namespace meevax::type_traits #endif // INCLUDED_MEEVAX_TYPE_TRAITS_IS_ARRAY_SUBSCRIPTABLE_HPP diff --git a/include/meevax/type_traits/is_dereferenceable.hpp b/include/meevax/type_traits/is_dereferenceable.hpp index 1ec3e18cf..381b7fa2c 100644 --- a/include/meevax/type_traits/is_dereferenceable.hpp +++ b/include/meevax/type_traits/is_dereferenceable.hpp @@ -19,20 +19,19 @@ #include -namespace meevax -{ -inline namespace type_traits +namespace meevax::inline type_traits { template + [[deprecated]] struct is_dereferenceable : public std::false_type {}; template + [[deprecated]] struct is_dereferenceable())>> : public std::true_type {}; -} // namespace type_traits -} // namespace meevax +} // namespace meevax::type_traits #endif // INCLUDED_MEEVAX_TYPE_TRAITS_IS_DEREFERENCEABLE_HPP diff --git a/include/meevax/type_traits/is_equality_comparable.hpp b/include/meevax/type_traits/is_equality_comparable.hpp index 9fd6ed4b3..badca8464 100644 --- a/include/meevax/type_traits/is_equality_comparable.hpp +++ b/include/meevax/type_traits/is_equality_comparable.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace type_traits +namespace meevax::inline type_traits { template struct is_equality_comparable @@ -40,7 +38,6 @@ inline namespace type_traits template inline constexpr bool is_equality_comparable_v = is_equality_comparable::value; -} // namespace type_traits -} // namespace meevax +} // namespace meevax::type_traits #endif // INCLUDED_MEEVAX_TYPE_TRAITS_IS_EQUALITY_COMPARABLE_HPP diff --git a/include/meevax/type_traits/is_output_streamable.hpp b/include/meevax/type_traits/is_output_streamable.hpp index eff1212c1..fe43b563c 100644 --- a/include/meevax/type_traits/is_output_streamable.hpp +++ b/include/meevax/type_traits/is_output_streamable.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace type_traits +namespace meevax::inline type_traits { template struct is_output_streamable : public std::false_type @@ -35,7 +33,6 @@ inline namespace type_traits template inline constexpr auto is_output_streamable_v = is_output_streamable::value; -} // namespace type_traits -} // namespace meevax +} // namespace meevax::type_traits #endif // INCLUDED_MEEVAX_TYPE_TRAITS_IS_OUTPUT_STREAMABLE_HPP diff --git a/include/meevax/type_traits/is_reference_wrapper.hpp b/include/meevax/type_traits/is_reference_wrapper.hpp index e49419765..2a6820944 100644 --- a/include/meevax/type_traits/is_reference_wrapper.hpp +++ b/include/meevax/type_traits/is_reference_wrapper.hpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace type_traits +namespace meevax::inline type_traits { template struct is_reference_wrapper @@ -32,7 +30,6 @@ inline namespace type_traits struct is_reference_wrapper> : public std::true_type {}; -} // namespace type_traits -} // namespace meevax +} // namespace meevax::type_traits #endif // INCLUDED_MEEVAX_TYPE_TRAITS_IS_REFERENCE_WRAPPER_HPP diff --git a/include/meevax/utility/combination.hpp b/include/meevax/utility/combination.hpp index 7908694df..9d4a81d83 100644 --- a/include/meevax/utility/combination.hpp +++ b/include/meevax/utility/combination.hpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { template struct make_combination; @@ -36,7 +34,6 @@ inline namespace kernel template using combination = typename make_combination, std::make_index_sequence>::type; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel #endif // INCLUDED_MEEVAX_UTILITY_COMBINATION_HPP diff --git a/include/meevax/utility/demangle.hpp b/include/meevax/utility/demangle.hpp index 684571fd9..ee6738372 100644 --- a/include/meevax/utility/demangle.hpp +++ b/include/meevax/utility/demangle.hpp @@ -20,14 +20,11 @@ #include #include -namespace meevax -{ -inline namespace utility +namespace meevax::inline utility { auto demangle(char const* const name) -> std::string; auto demangle(std::type_info const&) -> std::string; -} // namespace utility -} // namespace meevax +} // namespace meevax::utility #endif // INCLUDED_MEEVAX_UTILITY_DEMANGLE_HPP diff --git a/include/meevax/utility/hexdump.hpp b/include/meevax/utility/hexdump.hpp index e625262f2..d559072a0 100644 --- a/include/meevax/utility/hexdump.hpp +++ b/include/meevax/utility/hexdump.hpp @@ -17,13 +17,12 @@ #ifndef INCLUDED_MEEVAX_UTILITY_HEXDUMP #define INCLUDED_MEEVAX_UTILITY_HEXDUMP -#include // std::hex, +#include // std::endian +#include // std::hex #include // std::ostream #include // std::vector -namespace meevax -{ -inline namespace utility +namespace meevax::inline utility { template struct hexdump @@ -37,13 +36,21 @@ inline namespace utility } {} - // TODO UPDATE WITH STD::ENDIAN (C++20) auto operator()(std::ostream & os) const -> std::ostream & { - for (auto iter = data.rbegin(); iter != data.rend(); ++iter) // little endian - // for (auto iter = data.begin(); iter != data.end(); ++iter) // big endian + if constexpr (std::endian::native == std::endian::little) { - os << std::setw(2) << std::setfill('0') << std::hex << static_cast(*iter) << " "; + for (auto iter = data.rbegin(); iter != data.rend(); ++iter) + { + os << std::setw(2) << std::setfill('0') << std::hex << static_cast(*iter) << " "; + } + } + else + { + for (auto iter = data.begin(); iter != data.end(); ++iter) + { + os << std::setw(2) << std::setfill('0') << std::hex << static_cast(*iter) << " "; + } } return os; @@ -55,7 +62,6 @@ inline namespace utility { return hexdump(os); } -} // namespace utility -} // namespace meevax +} // namespace meevax::utility #endif // INCLUDED_MEEVAX_UTILITY_HEXDUMP diff --git a/include/meevax/utility/unwrap_reference_wrapper.hpp b/include/meevax/utility/unwrap_reference_wrapper.hpp index 9578d43e3..e742409ca 100644 --- a/include/meevax/utility/unwrap_reference_wrapper.hpp +++ b/include/meevax/utility/unwrap_reference_wrapper.hpp @@ -22,9 +22,7 @@ #include -namespace meevax -{ -inline namespace type_traits +namespace meevax::inline type_traits { inline auto unwrap_reference_wrapper = [](auto&& value) -> decltype(auto) { @@ -37,7 +35,6 @@ inline namespace type_traits return std::forward(value); } }; -} // namespace type_traits -} // namespace meevax +} // namespace meevax::type_traits #endif // INCLUDED_MEEVAX_TYPE_TRAITS_UNWRAP_REFERENCE_WRAPPER_HPP diff --git a/src/chrono/duration.cpp b/src/chrono/duration.cpp index 9a8b4f052..b5461e553 100644 --- a/src/chrono/duration.cpp +++ b/src/chrono/duration.cpp @@ -18,9 +18,7 @@ #include -namespace meevax -{ -inline namespace chrono +namespace meevax::inline chrono { auto operator <<(std::ostream & os, std::chrono::nanoseconds nanoseconds) -> std::ostream & { @@ -55,5 +53,4 @@ inline namespace chrono return os; } -} // namespace chrono -} // namespace meevax +} // namespace meevax::chrono diff --git a/src/kernel/binary_input_file_port.cpp b/src/kernel/binary_input_file_port.cpp index 6e71d1855..771506868 100644 --- a/src/kernel/binary_input_file_port.cpp +++ b/src/kernel/binary_input_file_port.cpp @@ -18,9 +18,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto binary_input_file_port::close() -> void { @@ -78,5 +76,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("open-binary-input-file ", datum.name) << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/binary_output_file_port.cpp b/src/kernel/binary_output_file_port.cpp index 96e4531bb..028ba632e 100644 --- a/src/kernel/binary_output_file_port.cpp +++ b/src/kernel/binary_output_file_port.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto binary_output_file_port::close() -> void { @@ -53,5 +51,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("open-binary-output-file ", datum.name) << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/boolean.cpp b/src/kernel/boolean.cpp index 474e49422..acb1e75bb 100644 --- a/src/kernel/boolean.cpp +++ b/src/kernel/boolean.cpp @@ -17,12 +17,9 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { let const t = make(true); let const f = make(false); -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/boot.cpp b/src/kernel/boot.cpp index f5ae8434f..c37621ef5 100644 --- a/src/kernel/boot.cpp +++ b/src/kernel/boot.cpp @@ -37,9 +37,7 @@ extern char ** environ; // for procedure get-environment-variables -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto boot() -> void { @@ -664,7 +662,23 @@ inline namespace kernel library.define("append!", [](let & xs) { - return std::accumulate(xs.begin(), xs.end(), unit, [](let & x, let const& y) { return append(x, y); }); + auto append = [](auto append, let & x, let & xs) -> auto & + { + if (xs.is()) + { + return x; + } + else if (x.is()) + { + return x = append(append, car(xs), cdr(xs)); + } + else + { + return meevax::append(x, append(append, car(xs), cdr(xs))); + } + }; + + return not xs.is() ? xs : append(append, car(xs), cdr(xs)); }); library.define("append-reverse", [](let const& xs) @@ -694,7 +708,23 @@ inline namespace kernel library.define("concatenate!", [](let & xs) { - return std::accumulate(car(xs).begin(), car(xs).end(), unit, [](let & x, let const& y) { return append(x, y); }); + auto concatenate = [](auto concatenate, let & x, let & xs) -> auto & + { + if (xs.is()) + { + return x; + } + else if (x.is()) + { + return x = concatenate(concatenate, car(xs), cdr(xs)); + } + else + { + return meevax::append(x, concatenate(concatenate, car(xs), cdr(xs))); + } + }; + + return not xs.is() ? xs : concatenate(concatenate, caar(xs), cdar(xs)); }); library.define("list-copy", [](let const& xs) @@ -2307,5 +2337,4 @@ inline namespace kernel }); }); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/box.cpp b/src/kernel/box.cpp index ba7624005..e53aec6c4 100644 --- a/src/kernel/box.cpp +++ b/src/kernel/box.cpp @@ -16,13 +16,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, box const& datum) -> std::ostream & { return os << magenta("#,(") << green("box ") << datum.first << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/character.cpp b/src/kernel/character.cpp index 107b8c49f..e91b1f7c2 100644 --- a/src/kernel/character.cpp +++ b/src/kernel/character.cpp @@ -19,9 +19,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { character::operator std::string() const { @@ -79,11 +77,4 @@ inline namespace kernel return os << cyan(static_cast(datum)); } } - - static_assert(std::is_pod_v); - - static_assert(std::is_standard_layout_v); - - static_assert(std::is_trivial_v); -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/closure.cpp b/src/kernel/closure.cpp index e5c9d58a6..e549dc7a0 100644 --- a/src/kernel/closure.cpp +++ b/src/kernel/closure.cpp @@ -16,13 +16,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, closure const& datum) -> std::ostream & { return os << magenta("#,(") << green("closure ") << faint("#;", &datum) << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/comparator.cpp b/src/kernel/comparator.cpp index 60013845b..da61e9cb9 100644 --- a/src/kernel/comparator.cpp +++ b/src/kernel/comparator.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto find(object & b) -> object & { @@ -100,5 +98,4 @@ inline namespace kernel auto forest = std::unordered_map(); return equal(x, y, forest); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/complex.cpp b/src/kernel/complex.cpp index 659d61be9..6d397d12d 100644 --- a/src/kernel/complex.cpp +++ b/src/kernel/complex.cpp @@ -19,9 +19,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { complex::complex(std::string const& token, int radix) { @@ -130,5 +128,4 @@ inline namespace kernel return atan(real_part(x), imag_part(x)); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/conditional_expand.cpp b/src/kernel/conditional_expand.cpp index 4907176a7..aa93cc5bf 100644 --- a/src/kernel/conditional_expand.cpp +++ b/src/kernel/conditional_expand.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto test(object const& requirement) -> bool { @@ -70,5 +68,4 @@ inline namespace kernel throw error(make("no matching clauses were found"), clauses); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/continuation.cpp b/src/kernel/continuation.cpp index 49cdda9d2..e02811e29 100644 --- a/src/kernel/continuation.cpp +++ b/src/kernel/continuation.cpp @@ -16,13 +16,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, continuation const& datum) -> std::ostream & { return os << magenta("#,(") << green("continuation ") << faint(";#", std::addressof(datum)) << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/dynamic_environment.cpp b/src/kernel/dynamic_environment.cpp index 62264a1a6..9223ec560 100644 --- a/src/kernel/dynamic_environment.cpp +++ b/src/kernel/dynamic_environment.cpp @@ -22,9 +22,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto dynamic_environment::execute(object const& control) -> object { @@ -505,5 +503,4 @@ inline namespace kernel } } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/environment.cpp b/src/kernel/environment.cpp index a27c5324c..39e5afd08 100644 --- a/src/kernel/environment.cpp +++ b/src/kernel/environment.cpp @@ -19,9 +19,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto environment::evaluate(object const& expression) -> object try { @@ -269,5 +267,4 @@ inline namespace kernel template struct configurator; template struct syntactic_environment; -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/eof.cpp b/src/kernel/eof.cpp index 3d94b1220..0881728fc 100644 --- a/src/kernel/eof.cpp +++ b/src/kernel/eof.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { let const eof_object = make(); @@ -26,5 +24,4 @@ inline namespace kernel { return os << magenta("#,(") << green("eof-object") << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/error.cpp b/src/kernel/error.cpp index ec56ed6b2..c3d5aa776 100644 --- a/src/kernel/error.cpp +++ b/src/kernel/error.cpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto error::irritants() const noexcept -> object const& { @@ -190,5 +188,4 @@ inline namespace kernel return os << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/exact_integer.cpp b/src/kernel/exact_integer.cpp index 527f8084e..1ba6f17e9 100644 --- a/src/kernel/exact_integer.cpp +++ b/src/kernel/exact_integer.cpp @@ -20,9 +20,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { let const e0 = make(0); let const e1 = make(1); @@ -102,5 +100,4 @@ inline namespace kernel { return os << cyan(std::unique_ptr(mpz_get_str(nullptr, 10, datum.value)).get()); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/ghost.cpp b/src/kernel/ghost.cpp index eefff637c..589ba02e4 100644 --- a/src/kernel/ghost.cpp +++ b/src/kernel/ghost.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, ghost const& ghost) -> std::ostream & { @@ -28,5 +26,4 @@ inline namespace kernel let const unspecified = make("unspecified"); let const undefined = make("undefined"); -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/identity.cpp b/src/kernel/identity.cpp index df5a8df5c..6f447147d 100644 --- a/src/kernel/identity.cpp +++ b/src/kernel/identity.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, absolute const& datum) -> std::ostream & { @@ -32,5 +30,4 @@ inline namespace kernel return os << blue(datum.first); } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/include.cpp b/src/kernel/include.cpp index df0e0485b..24fc0f8b4 100644 --- a/src/kernel/include.cpp +++ b/src/kernel/include.cpp @@ -19,9 +19,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto include(object const& names, bool case_sensitive, object const& xs) -> object { @@ -53,5 +51,4 @@ inline namespace kernel return reverse(xs); } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/input_file_port.cpp b/src/kernel/input_file_port.cpp index 52a3222d1..23ddddbf2 100644 --- a/src/kernel/input_file_port.cpp +++ b/src/kernel/input_file_port.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto input_file_port::close() -> void { @@ -44,5 +42,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("open-input-file ") << string(datum.name) << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/input_string_port.cpp b/src/kernel/input_string_port.cpp index a9e0b251f..a1bae3a3f 100644 --- a/src/kernel/input_string_port.cpp +++ b/src/kernel/input_string_port.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto input_string_port::close() -> void {} @@ -51,5 +49,4 @@ namespace literals return input_string_port(s).read(); } } // namespace literals -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/instruction.cpp b/src/kernel/instruction.cpp index e2e1d9dc3..c09e0744d 100644 --- a/src/kernel/instruction.cpp +++ b/src/kernel/instruction.cpp @@ -18,9 +18,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, instruction const& datum) -> std::ostream & { @@ -55,5 +53,4 @@ inline namespace kernel return os; } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/interaction_environment.cpp b/src/kernel/interaction_environment.cpp index f1ce7ed85..518baf58b 100644 --- a/src/kernel/interaction_environment.cpp +++ b/src/kernel/interaction_environment.cpp @@ -17,14 +17,11 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto interaction_environment() -> object const& { let static const interaction_environment = make(); return interaction_environment; } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/library.cpp b/src/kernel/library.cpp index 7a2e65e59..5e6a27876 100644 --- a/src/kernel/library.cpp +++ b/src/kernel/library.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { library::library(object const& declarations) : declarations { declarations } @@ -106,5 +104,4 @@ inline namespace kernel static auto libraries = std::map(); return libraries; } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/list.cpp b/src/kernel/list.cpp index 4b35dd936..c76b6c84c 100644 --- a/src/kernel/list.cpp +++ b/src/kernel/list.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto make_list(std::size_t size, object const& x) -> object { @@ -441,5 +439,4 @@ inline namespace kernel return length(x) < length(y) ? y : x; } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/number.cpp b/src/kernel/number.cpp index 82b762c3e..41fe499bc 100644 --- a/src/kernel/number.cpp +++ b/src/kernel/number.cpp @@ -24,9 +24,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator + (exact_integer const& a, exact_integer const& b) -> exact_integer { exact_integer n; mpz_add(n.value, a.value, b.value); return n; } auto operator - (exact_integer const& a, exact_integer const& b) -> exact_integer { exact_integer n; mpz_sub(n.value, a.value, b.value); return n; } @@ -1089,5 +1087,4 @@ inline namespace number return apply(f, x); } } // namespace number -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/optimizer.cpp b/src/kernel/optimizer.cpp index daa39b23b..8e895106e 100644 --- a/src/kernel/optimizer.cpp +++ b/src/kernel/optimizer.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { struct analysis { @@ -214,5 +212,4 @@ inline namespace kernel return code; } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/output_file_port.cpp b/src/kernel/output_file_port.cpp index 04a3f10f3..1e0af4c0a 100644 --- a/src/kernel/output_file_port.cpp +++ b/src/kernel/output_file_port.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto output_file_port::close() -> void { @@ -39,5 +37,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("open-output-file ") << datum.name << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/output_string_port.cpp b/src/kernel/output_string_port.cpp index 90b0bdec7..abf841485 100644 --- a/src/kernel/output_string_port.cpp +++ b/src/kernel/output_string_port.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto output_string_port::close() -> void {} @@ -38,5 +36,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("open-output-string ") << string(datum.ostringstream.str()) << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/procedure.cpp b/src/kernel/procedure.cpp index ef62ecc20..6daa10d4c 100644 --- a/src/kernel/procedure.cpp +++ b/src/kernel/procedure.cpp @@ -16,13 +16,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, primitive const& datum) -> std::ostream & { return os << magenta("#,(") << green("procedure ") << datum.name << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/ratio.cpp b/src/kernel/ratio.cpp index b6405a4ab..c74132111 100644 --- a/src/kernel/ratio.cpp +++ b/src/kernel/ratio.cpp @@ -18,9 +18,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { ratio::ratio() { @@ -105,5 +103,4 @@ inline namespace kernel return os << cyan(std::unique_ptr(mpq_get_str(nullptr, 10, datum.value), free).get()); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/standard_error_port.cpp b/src/kernel/standard_error_port.cpp index c5c7eabb8..a80e26dc2 100644 --- a/src/kernel/standard_error_port.cpp +++ b/src/kernel/standard_error_port.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto standard_error_port::close() -> void {} @@ -37,5 +35,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("standard-error") << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/standard_input_port.cpp b/src/kernel/standard_input_port.cpp index 4351b0187..623185cd5 100644 --- a/src/kernel/standard_input_port.cpp +++ b/src/kernel/standard_input_port.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { standard_input_port::standard_input_port() { @@ -47,5 +45,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("standard-input") << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/standard_output_port.cpp b/src/kernel/standard_output_port.cpp index dfd7cecfb..45fb5932b 100644 --- a/src/kernel/standard_output_port.cpp +++ b/src/kernel/standard_output_port.cpp @@ -16,9 +16,7 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto standard_output_port::close() -> void {} @@ -37,5 +35,4 @@ inline namespace kernel { return output << magenta("#,(") << blue("standard-output") << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/string.cpp b/src/kernel/string.cpp index 7b1fefed3..8157c9758 100644 --- a/src/kernel/string.cpp +++ b/src/kernel/string.cpp @@ -19,9 +19,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { string::string(std::string const& s) { @@ -87,5 +85,4 @@ inline namespace kernel return os << cyan("\""); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/symbol.cpp b/src/kernel/symbol.cpp index 866659fc8..d4ddff969 100644 --- a/src/kernel/symbol.cpp +++ b/src/kernel/symbol.cpp @@ -19,22 +19,13 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator +(symbol const& a, symbol const& b) -> std::string { return a.name + b.name; } - auto operator ==(symbol const& a, symbol const& b) -> bool { return a.name == b.name; } - auto operator !=(symbol const& a, symbol const& b) -> bool { return a.name != b.name; } - auto operator < (symbol const& a, symbol const& b) -> bool { return a.name < b.name; } - auto operator <=(symbol const& a, symbol const& b) -> bool { return a.name <= b.name; } - auto operator > (symbol const& a, symbol const& b) -> bool { return a.name > b.name; } - auto operator >=(symbol const& a, symbol const& b) -> bool { return a.name >= b.name; } - auto operator <<(std::ostream & os, symbol const& datum) -> std::ostream & { if (datum.name.empty()) @@ -73,5 +64,4 @@ inline namespace kernel make(name)); } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/textual_input_port.cpp b/src/kernel/textual_input_port.cpp index 7b1fe7fad..9e7ca2fb3 100644 --- a/src/kernel/textual_input_port.cpp +++ b/src/kernel/textual_input_port.cpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { textual_input_port::iterator::iterator(textual_input_port & input) : input { std::addressof(input) } @@ -692,5 +690,4 @@ inline namespace kernel throw read_error(make("an end of file is encountered after the beginning of an object's external representation, but the external representation is incomplete and therefore not parsable")); } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/textual_output_port.cpp b/src/kernel/textual_output_port.cpp index 34cb91722..c04de6091 100644 --- a/src/kernel/textual_output_port.cpp +++ b/src/kernel/textual_output_port.cpp @@ -17,9 +17,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto textual_output_port::flush() -> void { @@ -74,5 +72,4 @@ inline namespace kernel os << x; } } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/transformer.cpp b/src/kernel/transformer.cpp index b6e41ee79..f0a5e1295 100644 --- a/src/kernel/transformer.cpp +++ b/src/kernel/transformer.cpp @@ -16,13 +16,10 @@ #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator <<(std::ostream & os, transformer const& datum) -> std::ostream & { return os << magenta("#,(") << green("transformer ") << faint("#;", &datum) << magenta(")"); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/kernel/vector.cpp b/src/kernel/vector.cpp index 72bd231b4..75bef3d3e 100644 --- a/src/kernel/vector.cpp +++ b/src/kernel/vector.cpp @@ -21,9 +21,7 @@ #include #include -namespace meevax -{ -inline namespace kernel +namespace meevax::inline kernel { auto operator ==(heterogeneous_vector const& v, heterogeneous_vector const& u) -> bool { @@ -49,5 +47,4 @@ inline namespace kernel { return make(xs.begin(), xs.end()); } -} // namespace kernel -} // namespace meevax +} // namespace meevax::kernel diff --git a/src/main.cpp b/src/main.cpp index abaf2a308..4df72a3f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -50,7 +50,7 @@ auto main(int const argc, char const* const* const argv) -> int { try { - std::cout << u8"\u03bb> " << e.evaluate(standard_input_port().read()) << std::endl; + std::cout << "> " << e.evaluate(standard_input_port().read()) << std::endl; } catch (error const& error) { diff --git a/src/memory/model.cpp b/src/memory/model.cpp index 99b903677..b68dd8b96 100644 --- a/src/memory/model.cpp +++ b/src/memory/model.cpp @@ -19,9 +19,7 @@ #include -namespace meevax -{ -inline namespace memory +namespace meevax::inline memory { auto model::name() -> char const* { @@ -50,5 +48,4 @@ inline namespace memory throw std::logic_error("unknown C data model"); } } -} // namespace memory -} // namespace meevax +} // namespace meevax::memory diff --git a/src/utility/demangle.cpp b/src/utility/demangle.cpp index d686c8063..c7bfb0024 100644 --- a/src/utility/demangle.cpp +++ b/src/utility/demangle.cpp @@ -22,9 +22,7 @@ #include -namespace meevax -{ -inline namespace utility +namespace meevax::inline utility { auto demangle(char const* const name) -> std::string { @@ -47,5 +45,4 @@ inline namespace utility { return demangle(info.name()); } -} // namespace utility -} // namespace meevax +} // namespace meevax::utility diff --git a/test/bitset.cpp b/test/bitset.cpp index 5e471199b..4d77c4c9c 100644 --- a/test/bitset.cpp +++ b/test/bitset.cpp @@ -1,3 +1,4 @@ +#include #include #include #include