Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List #467

Merged
merged 24 commits into from
Oct 22, 2023
Merged

List #467

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
00ea63e
Update procedure `xcons` to built-in
yamacir-kit Oct 11, 2023
02990be
Update procedure `last` and `last-pair` to built-in
yamacir-kit Oct 11, 2023
74ea30f
Update procedure `circular-list?` and `circular-list` to built-in
yamacir-kit Oct 12, 2023
df6d498
Update procedures `first`, `second`... `tenth` to built-in
yamacir-kit Oct 12, 2023
13abe47
Update procedure `dotted-list?` to built-in
yamacir-kit Oct 13, 2023
80f4bb1
Update procedure `not-pair?` to built-in
yamacir-kit Oct 13, 2023
66dce30
Update procedure `take` to built-in
yamacir-kit Oct 13, 2023
442c020
Update procedure `cons*` to built-int
yamacir-kit Oct 14, 2023
4c6da13
Update procedure `iota` to built-in
yamacir-kit Oct 14, 2023
973f489
Update procedure `null-list?` to built-in
yamacir-kit Oct 14, 2023
7514b06
Update procedure `list-copy` to built-in
yamacir-kit Oct 14, 2023
1eccc2c
Update procedure `drop` to built-in
yamacir-kit Oct 15, 2023
f863adc
Update procedure `take!` to built-in
yamacir-kit Oct 15, 2023
437aabd
Update procedures `take-right` and `drop-right` to built-in
yamacir-kit Oct 15, 2023
9173c06
Update procedure `drop-right!` to built-in
yamacir-kit Oct 15, 2023
2d1294c
Update procedure `length+` to built-in
yamacir-kit Oct 15, 2023
b06ec44
Update procedure `append!` to built-in
yamacir-kit Oct 15, 2023
f1fc749
Update procedures `concatenate` and `concatenate!` to built-in
yamacir-kit Oct 15, 2023
218b232
Update procedure `reverse!` to built-in
yamacir-kit Oct 15, 2023
8fdd2e3
Update procedures `alist-cons` and `alist-copy` to built-in
yamacir-kit Oct 16, 2023
0ff6e21
Update procedures `append-reverse` and `append-reverse!` to built-in
yamacir-kit Oct 16, 2023
c194efc
Cleanup
yamacir-kit Oct 21, 2023
5699ce0
Update `environment` to allow import of the same identifier if are sa…
yamacir-kit Oct 21, 2023
737fbf1
Support R7RS-large library `(scheme list)`
yamacir-kit Oct 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,34 @@ Procedures for each standard are provided by the following R7RS-style libraries:
|:--------:|--------------|
| R4RS | [`(scheme r4rs)`](./basis/r4rs.ss)
| R5RS | [`(scheme r5rs)`](./basis/r5rs.ss)
| R7RS | [`(scheme base)`](./basis/r7rs.ss) [`(scheme box)`](./basis/r7rs.ss) [`(scheme case-lambda)`](./basis/r7rs.ss) [`(scheme char)`](./basis/r7rs.ss) [`(scheme complex)`](./basis/r7rs.ss) [`(scheme cxr)`](./basis/r7rs.ss) [`(scheme eval)`](./basis/r7rs.ss) [`(scheme file)`](./basis/r7rs.ss) [`(scheme inexact)`](./basis/r7rs.ss) [`(scheme lazy)`](./basis/r7rs.ss) [`(scheme load)`](./basis/r7rs.ss) [`(scheme process-context)`](./basis/r7rs.ss) [`(scheme read)`](./basis/r7rs.ss) [`(scheme repl)`](./basis/r7rs.ss) [`(scheme time)`](./basis/r7rs.ss) [`(scheme write)`](./basis/r7rs.ss)
| R7RS | [`(scheme base)`](./basis/r7rs.ss) [`(scheme box)`](./basis/r7rs.ss) [`(scheme case-lambda)`](./basis/r7rs.ss) [`(scheme char)`](./basis/r7rs.ss) [`(scheme complex)`](./basis/r7rs.ss) [`(scheme cxr)`](./basis/r7rs.ss) [`(scheme eval)`](./basis/r7rs.ss) [`(scheme file)`](./basis/r7rs.ss) [`(scheme inexact)`](./basis/r7rs.ss) [`(scheme lazy)`](./basis/r7rs.ss) [`(scheme list)`](./basis/r7rs.ss) [`(scheme load)`](./basis/r7rs.ss) [`(scheme process-context)`](./basis/r7rs.ss) [`(scheme read)`](./basis/r7rs.ss) [`(scheme repl)`](./basis/r7rs.ss) [`(scheme time)`](./basis/r7rs.ss) [`(scheme write)`](./basis/r7rs.ss)

### SRFIs

| Number | Title | Library name | Note |
|--------------------------------------------------------:|--------------------------------------------------------|-------------------------------------|-----------------------------------|
| [ 0](https://srfi.schemers.org/srfi-0/srfi-0.html) | Feature-based conditional expansion construct | [`(srfi 0)`](./basis/srfi-0.ss) | R7RS 4.2.1 |
| [ 1](https://srfi.schemers.org/srfi-1/srfi-1.html) | List Library | [`(srfi 1)`](./basis/srfi-1.ss) | |
| [ 4](https://srfi.schemers.org/srfi-4/srfi-4.html) | Homogeneous numeric vector datatypes | [`(srfi 4)`](./basis/srfi-4.ss) | R7RS 6.9 |
| [ 6](https://srfi.schemers.org/srfi-6/srfi-6.html) | Basic String Ports | [`(srfi 6)`](./basis/srfi-6.ss) | R7RS 6.13 |
| [ 8](https://srfi.schemers.org/srfi-8/srfi-8.html) | receive: Binding to multiple values | [`(srfi 8)`](./basis/srfi-8.ss) | |
| [ 9](https://srfi.schemers.org/srfi-9/srfi-9.html) | Defining Record Types | [`(srfi 9)`](./basis/srfi-9.ss) | R7RS 5.5 |
| [ 10](https://srfi.schemers.org/srfi-10/srfi-10.html) | #, external form | | |
| [ 11](https://srfi.schemers.org/srfi-11/srfi-11.html) | Syntax for receiving multiple values | [`(srfi 11)`](./basis/srfi-11.ss) | R7RS 4.2.2 |
| [ 16](https://srfi.schemers.org/srfi-16/srfi-16.html) | Syntax for procedures of variable arity | [`(srfi 16)`](./basis/srfi-16.ss) | R7RS 4.2.9 |
| [ 23](https://srfi.schemers.org/srfi-23/srfi-23.html) | Error reporting mechanism | [`(srfi 23)`](./basis/srfi-23.ss) | R7RS 6.11 |
| [ 30](https://srfi.schemers.org/srfi-30/srfi-30.html) | Nested Multi-line Comments | | R7RS 2.2 |
| [ 31](https://srfi.schemers.org/srfi-31/srfi-31.html) | A special form rec for recursive evaluation | [`(srfi 31)`](./basis/srfi-31.ss) | |
| [ 34](https://srfi.schemers.org/srfi-34/srfi-34.html) | Exception Handling for Programs | [`(srfi 34)`](./basis/srfi-34.ss) | R7RS 6.11 |
| [ 38](https://srfi.schemers.org/srfi-38/srfi-38.html) | External Representation for Data With Shared Structure | [`(srfi 38)`](./basis/srfi-38.ss) | R7RS 6.13.3 |
| [ 39](https://srfi.schemers.org/srfi-39/srfi-39.html) | Parameter objects | [`(srfi 39)`](./basis/srfi-39.ss) | R7RS 4.2.6 |
| [ 45](https://srfi.schemers.org/srfi-45/srfi-45.html) | Primitives for Expressing Iterative Lazy Algorithms | [`(srfi 45)`](./basis/srfi-45.ss) | R7RS 4.2.5 |
| [ 62](https://srfi.schemers.org/srfi-62/srfi-62.html) | S-expression comments | | R7RS 2.2 |
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
| [ 98](https://srfi.schemers.org/srfi-98/srfi-98.html) | An interface to access environment variables | [`(srfi 98)`](./basis/srfi-98.ss) | R7RS 6.14 |
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | [`(scheme box)`](./basis/r7rs.ss) |
| [149](https://srfi.schemers.org/srfi-149/srfi-149.html) | Basic syntax-rules template extensions | [`(srfi 149)`](./basis/srfi-149.ss) | R7RS 4.3.2 |
| Number | Title | Library name | Note |
|--------------------------------------------------------:|--------------------------------------------------------|-------------------------------------|------------------------------------|
| [ 0](https://srfi.schemers.org/srfi-0/srfi-0.html) | Feature-based conditional expansion construct | [`(srfi 0)`](./basis/srfi-0.ss) | R7RS 4.2.1 |
| [ 1](https://srfi.schemers.org/srfi-1/srfi-1.html) | List Library | [`(srfi 1)`](./basis/srfi-1.ss) | [`(scheme list)`](./basis/r7rs.ss) |
| [ 4](https://srfi.schemers.org/srfi-4/srfi-4.html) | Homogeneous numeric vector datatypes | [`(srfi 4)`](./basis/srfi-4.ss) | R7RS 6.9 |
| [ 6](https://srfi.schemers.org/srfi-6/srfi-6.html) | Basic String Ports | [`(srfi 6)`](./basis/srfi-6.ss) | R7RS 6.13 |
| [ 8](https://srfi.schemers.org/srfi-8/srfi-8.html) | receive: Binding to multiple values | [`(srfi 8)`](./basis/srfi-8.ss) | |
| [ 9](https://srfi.schemers.org/srfi-9/srfi-9.html) | Defining Record Types | [`(srfi 9)`](./basis/srfi-9.ss) | R7RS 5.5 |
| [ 10](https://srfi.schemers.org/srfi-10/srfi-10.html) | #, external form | | |
| [ 11](https://srfi.schemers.org/srfi-11/srfi-11.html) | Syntax for receiving multiple values | [`(srfi 11)`](./basis/srfi-11.ss) | R7RS 4.2.2 |
| [ 16](https://srfi.schemers.org/srfi-16/srfi-16.html) | Syntax for procedures of variable arity | [`(srfi 16)`](./basis/srfi-16.ss) | R7RS 4.2.9 |
| [ 23](https://srfi.schemers.org/srfi-23/srfi-23.html) | Error reporting mechanism | [`(srfi 23)`](./basis/srfi-23.ss) | R7RS 6.11 |
| [ 30](https://srfi.schemers.org/srfi-30/srfi-30.html) | Nested Multi-line Comments | | R7RS 2.2 |
| [ 31](https://srfi.schemers.org/srfi-31/srfi-31.html) | A special form rec for recursive evaluation | [`(srfi 31)`](./basis/srfi-31.ss) | |
| [ 34](https://srfi.schemers.org/srfi-34/srfi-34.html) | Exception Handling for Programs | [`(srfi 34)`](./basis/srfi-34.ss) | R7RS 6.11 |
| [ 38](https://srfi.schemers.org/srfi-38/srfi-38.html) | External Representation for Data With Shared Structure | [`(srfi 38)`](./basis/srfi-38.ss) | R7RS 6.13.3 |
| [ 39](https://srfi.schemers.org/srfi-39/srfi-39.html) | Parameter objects | [`(srfi 39)`](./basis/srfi-39.ss) | R7RS 4.2.6 |
| [ 45](https://srfi.schemers.org/srfi-45/srfi-45.html) | Primitives for Expressing Iterative Lazy Algorithms | [`(srfi 45)`](./basis/srfi-45.ss) | R7RS 4.2.5 |
| [ 62](https://srfi.schemers.org/srfi-62/srfi-62.html) | S-expression comments | | R7RS 2.2 |
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
| [ 98](https://srfi.schemers.org/srfi-98/srfi-98.html) | An interface to access environment variables | [`(srfi 98)`](./basis/srfi-98.ss) | R7RS 6.14 |
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | [`(scheme box)`](./basis/r7rs.ss) |
| [149](https://srfi.schemers.org/srfi-149/srfi-149.html) | Basic syntax-rules template extensions | [`(srfi 149)`](./basis/srfi-149.ss) | R7RS 4.3.2 |

## Installation

Expand All @@ -91,7 +91,7 @@ Procedures for each standard are provided by the following R7RS-style libraries:
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make package
sudo apt install build/meevax_0.5.35_amd64.deb
sudo apt install build/meevax_0.5.59_amd64.deb
```

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

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

## Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.35
0.5.59
Empty file added basis/]
Empty file.
32 changes: 24 additions & 8 deletions basis/r7rs.ss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(import (only (meevax core) include include-case-insensitive)
(only (meevax error) error-object? read-error? file-error?)
(only (meevax macro-transformer) er-macro-transformer)
(only (meevax list) make-list)
(only (meevax list) make-list list-copy)
(only (meevax number) exact-integer? exact-integer-square-root)
(only (meevax port) binary-port? eof-object flush get-output-u8vector open-input-u8vector open-output-u8vector open? port? standard-error-port standard-input-port standard-output-port textual-port?)
(prefix (meevax read) %)
Expand Down Expand Up @@ -191,13 +191,6 @@
(define (list-set! xs k x)
(set-car! (list-tail xs k) x))

(define (list-copy x)
(let list-copy ((x x))
(if (pair? x)
(cons (car x)
(list-copy (cdr x)))
x)))

(define symbol=? eqv?)

(define bytevector? u8vector?)
Expand Down Expand Up @@ -472,6 +465,29 @@
(import (srfi 45))
(export delay (rename lazy delay-force) force promise? (rename eager make-promise)))

(define-library (scheme list)
(import (srfi 1))
(export cons list xcons cons* make-list list-tabulate list-copy circular-list
iota pair? null? proper-list? circular-list? dotted-list? not-pair?
null-list? list= car cdr caar cadr cdar cddr caaar caadr cadar caddr
cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr
caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
list-ref first second third fourth fifth sixth seventh eighth ninth
tenth car+cdr take take! take-right drop drop-right drop-right!
split-at split-at! last last-pair length length+ append append!
concatenate concatenate! reverse reverse! append-reverse
append-reverse! zip unzip1 unzip2 unzip3 unzip4 unzip5 count map map!
filter-map map-in-order fold fold-right unfold unfold-right pair-fold
pair-fold-right reduce reduce-right append-map append-map! for-each
pair-for-each filter filter! partition partition! remove remove! memq
memv member find find-tail any every list-index take-while
take-while! drop-while span span! break break! delete delete!
delete-duplicates delete-duplicates! assq assv assoc alist-cons
alist-copy alist-delete alist-delete! lset<= lset= lset-adjoin
lset-union lset-union! lset-intersection lset-intersection!
lset-difference lset-difference! lset-xor lset-xor!
lset-diff+intersection lset-diff+intersection! set-car! set-cdr!))

(define-library (scheme load)
(import (only (scheme r5rs) load))
(export load))
Expand Down
Loading