Skip to content

Commit

Permalink
Update kernel/basis.hpp to be header only
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Sep 24, 2023
1 parent 78ee6c4 commit 2631592
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build
include/meevax/kernel/basis.hpp
include/meevax/unicode
src/kernel/basis.cpp
src/kernel/version.cpp
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ foreach(EACH IN LISTS ${PROJECT_NAME}_BASIS_SOURCES)
endforeach()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/README.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/basis.cpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/meevax/kernel/basis.hpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp)

# ---- Target kernel -----------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Subset of R7RS-small.
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make package
sudo apt install build/meevax_0.4.813_amd64.deb
sudo apt install build/meevax_0.4.814_amd64.deb
```

or
Expand Down Expand Up @@ -106,9 +106,9 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|-------------|-------------
| `all` | Build shared-library `libmeevax.0.4.813.so` and executable `meevax`
| `all` | Build shared-library `libmeevax.0.4.814.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.4.813_amd64.deb`
| `package` | Generate debian package `meevax_0.4.814_amd64.deb`
| `install` | Copy files into `/usr/local` directly

## Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.813
0.4.814
34 changes: 15 additions & 19 deletions configure/basis.cpp → configure/basis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,24 @@
limitations under the License.
*/

#include <meevax/kernel/basis.hpp>
#include <meevax/kernel/environment.hpp>
#include <meevax/kernel/input_string_port.hpp>
#include <meevax/kernel/interaction_environment.hpp>
#ifndef INCLUDED_MEEVAX_KERNEL_BASIS_HPP
#define INCLUDED_MEEVAX_KERNEL_BASIS_HPP

#include <array>

namespace meevax
{
inline namespace kernel
{
auto basis() -> std::vector<char const*>
template <typename... Ts>
constexpr auto make_array(Ts&&... xs) -> std::array<std::decay_t<std::common_type_t<Ts...>>, sizeof...(Ts)>
{
return { std::forward<decltype(xs)>(xs)... };
}

constexpr auto basis()
{
return {
return make_array(
R"##(${${PROJECT_NAME}_BASIS_meevax.ss})##",
R"##(${${PROJECT_NAME}_BASIS_r4rs-essential.ss})##",
R"##(${${PROJECT_NAME}_BASIS_r4rs.ss})##",
Expand All @@ -48,19 +54,9 @@ inline namespace kernel
R"##(${${PROJECT_NAME}_BASIS_srfi-78.ss})##",
R"##(${${PROJECT_NAME}_BASIS_srfi-98.ss})##",
R"##(${${PROJECT_NAME}_BASIS_srfi-111.ss})##",
R"##(${${PROJECT_NAME}_BASIS_srfi-149.ss})##",
};
}

auto boot(std::vector<char const*> const& libraries) -> void
{
for (auto&& library : libraries)
{
for (let const& x : input_string_port(library))
{
interaction_environment().as<environment>().evaluate(x);
}
}
R"##(${${PROJECT_NAME}_BASIS_srfi-149.ss})##");
}
} // namespace kernel
} // namespace meevax

#endif // INCLUDED_MEEVAX_KERNEL_BASIS_HPP
32 changes: 0 additions & 32 deletions include/meevax/kernel/basis.hpp

This file was deleted.

15 changes: 15 additions & 0 deletions include/meevax/kernel/boot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,26 @@
#ifndef INCLUDED_MEEVAX_KERNEL_BOOT_HPP
#define INCLUDED_MEEVAX_KERNEL_BOOT_HPP

#include <meevax/kernel/environment.hpp>
#include <meevax/kernel/interaction_environment.hpp>

namespace meevax
{
inline namespace kernel
{
auto boot() -> void;

template <typename Sources>
auto boot(Sources const& sources) -> void
{
for (auto&& source : sources)
{
for (let const& x : input_string_port(source))
{
interaction_environment().as<environment>().evaluate(x);
}
}
}
} // namespace kernel
} // namespace meevax

Expand Down
1 change: 0 additions & 1 deletion include/meevax/kernel/syntactic_environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <meevax/kernel/identity.hpp>
#include <meevax/kernel/implementation_dependent.hpp>
#include <meevax/kernel/include.hpp>
#include <meevax/kernel/list.hpp>
#include <meevax/kernel/transformer.hpp>

namespace meevax
Expand Down

0 comments on commit 2631592

Please sign in to comment.