Skip to content

Commit

Permalink
Merge pull request #426 from yamacir-kit/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
yamacir-kit authored Dec 18, 2022
2 parents 2921d03 + 41c34b3 commit c2932cd
Show file tree
Hide file tree
Showing 81 changed files with 1,831 additions and 1,315 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
matrix:
compiler: [ g++, clang++ ]
configuration: [ Debug, Release ]
system: [ ubuntu-18.04, ubuntu-20.04 ]
system: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: ./script/setup.sh --all
- run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
- run: cmake --build build --target safe-install.deb
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
branches:
- master
jobs:
Debian:
runs-on: ubuntu-20.04
Ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
- run: ./script/setup.sh --required
- run: ./script/setup.sh
- run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- run: cmake --build build --target package
- uses: actions/create-release@v1
Expand Down
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ string(CONCAT UNSTABLE_OPTIMIZATION_OPTIONS # JOIN available if VERSION > 3.12
# "-mtune=native "
)

# NOTE: The `-gdwarf-4` option is set due to the following issues with Clang 14 and Valgrind versions below 3.20: https://bugzilla.mozilla.org/show_bug.cgi?id=1758782
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -pipe")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ${UNSTABLE_OPTIMIZATION_OPTIONS}")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -gdwarf-4")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -gdwarf-4 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ${UNSTABLE_OPTIMIZATION_OPTIONS}")

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Subset of R7RS-small.
To install the above software, it is easy to use the following script.

``` bash
$ ./script/setup.sh --required
$ ./script/setup.sh
```

## Installation
Expand Down Expand Up @@ -105,9 +105,9 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|:-------------------|:--
| `all` (default) | Build shared-library `libmeevax.0.4.363.so` and executable `meevax`.
| `all` (default) | Build shared-library `libmeevax.0.4.439.so` and executable `meevax`.
| `test` | Test executable `meevax`.
| `package` | Generate debian package `meevax_0.4.363_amd64.deb`.
| `package` | Generate debian package `meevax_0.4.439_amd64.deb`.
| `install` | Copy files into `/usr/local` __(1)__.
| `install.deb` | `all` + `package` + `sudo apt install <meevax>.deb`
| `safe-install.deb` | `all` + `test` + `package` + `sudo apt install <meevax>.deb`
Expand All @@ -122,13 +122,11 @@ __(1)__ Meevax installed by `make install` cannot be uninstalled by the system's
## Usage

```
Meevax Lisp System, version 0.4.363
Meevax Lisp System, version 0.4.439
Usage: meevax [OPTION...] [FILE...]
Options:
-b, --batch Suppress any system output.
-d, --debug Deprecated.
-e, --evaluate=STRING Read and evaluate given STRING at configuration step.
-h, --help Display this help text and exit.
-i, --interactive Take over control of root environment.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.363
0.4.439
3 changes: 2 additions & 1 deletion basis/r4rs-essential.ss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
(read %read))
(meevax string)
(meevax symbol)
(meevax syntax)
(rename (meevax syntax)
(sequence begin))
(meevax vector)
(rename (meevax write)
(write %write))
Expand Down
47 changes: 15 additions & 32 deletions basis/r7rs.ss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(define-library (scheme base)
(import (only (meevax error) error? read-error? file-error?)
(import (only (meevax error) error-object? read-error? file-error?)
(only (meevax number) exact-integer?)
(only (meevax vector) vector-append vector-copy vector-copy! string->vector)
(only (meevax port)
Expand Down Expand Up @@ -337,11 +337,6 @@
(string-map-1 x)
(string-map-n (cons x xs))))

(define (error-object? x)
(or (error? x)
(read-error? x)
(file-error? x)))

; (define (call-with-port port procedure)
; (let-values ((results (procedure port)))
; (close-port port)
Expand Down Expand Up @@ -461,33 +456,17 @@

(define-library (scheme cxr)
(import (meevax pair))
(export caaar
caadr
cadar
caddr
cdaar
cdadr
cddar
cdddr
caaaar
caaadr
caadar
caaddr
cadaar
cadadr
caddar
cadddr
cdaaar
cdaadr
cdadar
cdaddr
cddaar
cddadr
cdddar
cddddr))
(export caaar caaaar cdaaar
caadr caaadr cdaadr
cadar caadar cdadar
caddr caaddr cdaddr
cdaar cadaar cddaar
cdadr cadadr cddadr
cddar caddar cdddar
cdddr cadddr cddddr))

(define-library (scheme char)
(import (only (meevax character) char-codepoint)
(import (only (meevax character) digit-value)
(only (scheme r5rs)
char-ci=?
char-ci<?
Expand Down Expand Up @@ -518,7 +497,7 @@
char-whitespace?
char-upper-case?
char-lower-case?
(rename char-codepoint digit-value)
digit-value
char-upcase
char-downcase
(rename char-downcase char-foldcase)
Expand Down Expand Up @@ -578,6 +557,10 @@
(car x)
(current-input-port))))))

(define-library (scheme repl)
(import (only (meevax environment) interaction-environment))
(export interaction-environment))

(define-library (scheme write)
(import (prefix (meevax write) %)
(scheme base)
Expand Down
2 changes: 1 addition & 1 deletion basis/srfi-149.ss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(define-library (srfi 149)
(import (only (meevax macro) identifier->symbol)
(import (only (meevax symbol) identifier->symbol)
(only (meevax syntax) define-syntax quote-syntax)
(scheme r4rs)
(srfi 211 explicit-renaming)
Expand Down
3 changes: 2 additions & 1 deletion basis/srfi-211.ss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
(meevax list)
(meevax macro)
(meevax pair)
(meevax syntax))
(rename (meevax syntax)
(sequence begin)))

(begin (define (er-macro-transformer f)
(lambda (form use-env mac-env)
Expand Down
4 changes: 2 additions & 2 deletions basis/srfi-23.ss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(define-library (srfi 23)
(import (only (meevax error) make-error)
(import (only (meevax error) error-object)
(only (scheme r5rs) define apply)
(only (srfi 34) raise))
(export error)
(begin (define (error . xs)
(raise (apply make-error xs)))))
(raise (apply error-object xs)))))
3 changes: 2 additions & 1 deletion basis/srfi-6.ss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(define-library (srfi 6)
(import (meevax port))
(import (meevax port)
(meevax string))
(export (rename port->string get-output-string)
(rename string->port open-input-string)
(rename string->port open-output-string)))
4 changes: 1 addition & 3 deletions configure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Subset of R7RS-small.
To install the above software, it is easy to use the following script.

``` bash
$ ./script/setup.sh --required
$ ./script/setup.sh
```

## Installation
Expand Down Expand Up @@ -127,8 +127,6 @@ Meevax Lisp System, version ${PROJECT_VERSION}
Usage: meevax [OPTION...] [FILE...]
Options:
-b, --batch Suppress any system output.
-d, --debug Deprecated.
-e, --evaluate=STRING Read and evaluate given STRING at configuration step.
-h, --help Display this help text and exit.
-i, --interactive Take over control of root environment.
Expand Down
14 changes: 7 additions & 7 deletions configure/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,43 @@ namespace meevax
{
inline namespace kernel
{
auto gmp_version() -> const_reference
auto gmp_version() -> object const&
{
let static const version = make<symbol>(::gmp_version);
return version;
}

auto version() -> const_reference
auto version() -> object const&
{
let static const version = make<symbol>("${PROJECT_VERSION}");
return version;
}

auto major_version() -> const_reference
auto major_version() -> object const&
{
let static const version = make<exact_integer>("${PROJECT_VERSION_MAJOR}");
return version;
}

auto minor_version() -> const_reference
auto minor_version() -> object const&
{
let static const version = make<exact_integer>("${PROJECT_VERSION_MINOR}");
return version;
}

auto patch_version() -> const_reference
auto patch_version() -> object const&
{
let static const version = make<exact_integer>("${PROJECT_VERSION_PATCH}");
return version;
}

auto exact_version() -> const_reference
auto exact_version() -> object const&
{
let static const version = make<symbol>("${${PROJECT_NAME}_VERSION_EXACT}");
return version;
}

auto features() -> const_reference
auto features() -> object const&
{
let static const features = list(
make<symbol>("r4rs"),
Expand Down
2 changes: 1 addition & 1 deletion include/meevax/kernel/boolean.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inline namespace kernel
let extern const t;
let extern const f;

auto select(const_reference) -> bool;
auto is_truthy(object const&) -> bool;
} // namespace kernel
} // namespace meevax

Expand Down
4 changes: 2 additions & 2 deletions include/meevax/kernel/closure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ inline namespace kernel
{
using pair::pair;

auto c() const -> const_reference;
auto c() const -> object const&;

auto e() const -> const_reference;
auto e() const -> object const&;
};

auto operator <<(std::ostream &, closure const&) -> std::ostream &;
Expand Down
2 changes: 1 addition & 1 deletion include/meevax/kernel/comparator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ inline namespace kernel
return eq(x, y) or x.compare(y);
};

auto equal(const_reference, const_reference) -> bool;
auto equal(object const&, object const&) -> bool;
} // namespace kernel
} // namespace meevax

Expand Down
6 changes: 3 additions & 3 deletions include/meevax/kernel/complex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ inline namespace kernel

explicit complex(std::string const&, int = 10);

auto canonicalize() const -> value_type;
auto canonicalize() const -> object;

auto imag() const noexcept -> const_reference;
auto imag() const noexcept -> object const&;

auto real() const noexcept -> const_reference;
auto real() const noexcept -> object const&;

explicit operator std::complex<double>();
};
Expand Down
Loading

0 comments on commit c2932cd

Please sign in to comment.