Skip to content

Commit ff9449a

Browse files
authored
Merge pull request #350 from yamacir-kit/cleanup
Cleanup
2 parents ed77a03 + 4196dd4 commit ff9449a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+638
-1515
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
benchmark/gmon.*
21
build
3-
include/meevax/kernel/version.hpp
2+
src/kernel/version.cpp

CMakeLists.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ else()
5252
set(${PROJECT_NAME}_BYTE_ORDER "little-endian")
5353
endif()
5454

55-
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/configure/version.hpp)
56-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.hpp
57-
${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/kernel/version.hpp)
55+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp)
56+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp
57+
${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp)
5858
endif()
5959

6060
# ---- Convert Basis-Library Sources to Binary ---------------------------------
@@ -84,8 +84,7 @@ add_library(kernel SHARED "")
8484

8585
add_library(${PROJECT_NAME}::kernel ALIAS kernel)
8686

87-
file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp
88-
${CMAKE_CURRENT_SOURCE_DIR}/src/standard.cpp)
87+
file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp)
8988

9089
target_sources(kernel PRIVATE ${${PROJECT_NAME}_BASIS}
9190
PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES})

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ sudo rm -rf /usr/local/share/meevax
100100

101101
| Target Name | Description
102102
|:-------------------|:--
103-
| `all` (default) | Build shared-library `libmeevax.0.3.597.so` and executable `meevax`.
103+
| `all` (default) | Build shared-library `libmeevax.0.3.629.so` and executable `meevax`.
104104
| `test` | Test executable `meevax`.
105-
| `package` | Generate debian package `meevax_0.3.597_amd64.deb`.
105+
| `package` | Generate debian package `meevax_0.3.629_amd64.deb`.
106106
| `install` | Copy files into `/usr/local` __(1)__.
107107
| `install.deb` | `all` + `package` + `sudo apt install <meevax>.deb`
108108
| `safe-install.deb` | `all` + `test` + `package` + `sudo apt install <meevax>.deb`
@@ -117,7 +117,7 @@ __(1)__ Meevax installed by `make install` cannot be uninstalled by the system's
117117
## Usage
118118

119119
```
120-
Meevax Lisp System, version 0.3.597
120+
Meevax Lisp System, version 0.3.629
121121
122122
Usage: meevax [OPTION...] [FILE...]
123123

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.597
1+
0.3.629

basis/overture.ss

+21-68
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
(lambda form
3333
(transform form (current-evaluator) free-identifier=?))))
3434

35-
(define (null? x) (eqv? x '()))
36-
37-
(define (caar x) (car (car x)))
38-
(define (cadr x) (car (cdr x)))
39-
(define (cdar x) (cdr (car x)))
40-
(define (cddr x) (cdr (cdr x)))
41-
4235
(define (unspecified) (if #f #f))
4336

4437
(define-syntax (cond . clauses)
@@ -149,27 +142,24 @@
149142
(define-syntax (unless test . body) `(,if (,not ,test) (,begin ,@body))) ; TODO MOVE INTO (scheme base)
150143

151144
(define (map f x . xs) ; map-unorder
152-
(define (map-1 f x xs)
153-
(if (pair? x)
154-
(map-1 f
155-
(cdr x)
156-
(cons (f (car x)) xs))
157-
(reverse xs)))
158-
159-
(define (map-2+ f xs xss)
160-
(if (every pair? xs)
161-
(map-2+ f
162-
(map-1 cdr xs '())
163-
(cons (apply f (map-1 car xs '())) xss))
164-
(reverse xss)))
165-
166-
(if (null? xs)
167-
(map-1 f x '())
168-
(map-2+ f (cons x xs) '())))
145+
(define (map-1 f x xs)
146+
(if (pair? x)
147+
(map-1 f
148+
(cdr x)
149+
(cons (f (car x)) xs))
150+
(reverse xs)))
151+
(define (map-2+ f xs xss)
152+
(if (every pair? xs)
153+
(map-2+ f
154+
(map-1 cdr xs '())
155+
(cons (apply f (map-1 car xs '())) xss))
156+
(reverse xss)))
157+
(if (null? xs)
158+
(map-1 f x '())
159+
(map-2+ f (cons x xs) '())))
169160

170161
(define (apply f x . xs) ; for map
171162
(define (apply-1 f xs) (f . xs))
172-
173163
(if (null? xs)
174164
(apply-1 f x)
175165
((lambda (rxs)
@@ -185,7 +175,6 @@
185175
(if (f (car x))
186176
(every-1 f (cdr x))
187177
#f)))
188-
189178
(if (null? xs)
190179
(if (pair? x)
191180
(every-1 f x)
@@ -202,14 +191,12 @@
202191
(if result result (any-1 f (cdr x))))
203192
(f (car x)))
204193
(f (car x))))
205-
206194
(define (any-2+ f xs)
207195
(if (every pair? xs)
208196
((lambda (result)
209197
(if result result (any-2+ f (map cdr xs))))
210198
(apply f (map car xs)))
211199
#f))
212-
213200
(if (null? xs)
214201
(if (pair? x)
215202
(any-1 f x)
@@ -589,6 +576,8 @@
589576
(windup! %current-dynamic-extents current-dynamic-extents)
590577
(k1 k2)))))))
591578

579+
(define call/cc call-with-current-continuation)
580+
592581
; (define values
593582
; (lambda xs
594583
; (call-with-current-continuation
@@ -651,70 +640,34 @@
651640
(define (call-with-output-file path procedure)
652641
(call-with-port (open-output-file path) procedure))
653642

654-
(define (standard-input-port? x)
655-
(eq? x (standard-input-port)))
656-
657-
(define (standard-output-port? x)
658-
(eq? x (standard-output-port)))
659-
660-
(define (standard-error-port? x)
661-
(eq? x (standard-error-port)))
662-
663-
(define (standard-port? x)
664-
(or (standard-input-port? x)
665-
(standard-output-port? x)
666-
(standard-error-port? x)))
667-
668-
(define (input-port? x)
669-
(or (input-file-port? x)
670-
(input-string-port? x)
671-
(standard-input-port? x)))
672-
673-
(define (output-port? x)
674-
(or (output-file-port? x)
675-
(output-string-port? x)
676-
(standard-output-port? x)
677-
(standard-error-port? x)))
678-
679643
(define (close-port x)
680644
(cond ((input-port? x) (close-input-port x))
681645
((output-port? x) (close-output-port x))
682646
(else (unspecified))))
683647

684-
(define (close-input-port x)
685-
(cond ((input-file-port? x)
686-
(close-input-file-port x))
687-
(else (unspecified))))
688-
689-
(define (close-output-port x)
690-
(cond ((output-file-port? x)
691-
(close-output-file-port x))
692-
(else (unspecified))))
693-
694648
(define (read . x) (%read (if (pair? x) (car x) (current-input-port))))
695649
(define (read-char . x) (%read-char (if (pair? x) (car x) (current-input-port))))
696650
(define (peek-char . x) (%peek-char (if (pair? x) (car x) (current-input-port))))
697651
(define (char-ready? . x) (%char-ready? (if (pair? x) (car x) (current-input-port))))
698652

699653
(define (write-simple x . port) (%write-simple x (if (pair? port) (car port) (current-output-port))))
700-
(define (write-char x . port) (%write-char x (if (pair? port) (car port) (current-output-port))))
654+
(define (write-char x . port) (put-char x (if (pair? port) (car port) (current-output-port))))
701655

702656
(define write write-simple)
703657

704658
(define (display datum . port)
705659
(cond ((char? datum) (apply write-char datum port))
706660
((string? datum) (apply write-string datum port))
707-
((path? datum) (apply write-path datum port))
708661
(else (apply write datum port))))
709662

710663
(define (newline . port)
711664
(apply write-char #\newline port))
712665

713666
(define (write-string string . xs)
714667
(case (length xs)
715-
((0) (%write-string string (current-output-port)))
716-
((1) (%write-string string (car xs)))
717-
(else (%write-string (apply string-copy string (cadr xs)) (car xs)))))
668+
((0) (put-string string (current-output-port)))
669+
((1) (put-string string (car xs)))
670+
(else (put-string (apply string-copy string (cadr xs)) (car xs)))))
718671

719672
(define (flush-output-port . port)
720673
(%flush-output-port (if (pair? port)

basis/r7rs.ss

-70
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ parameterize ; is defined in srfi-39.ss
319319
; TODO string-for-each
320320
; TODO vector-for-each
321321

322-
(define call/cc call-with-current-continuation)
323-
324322
; ---- 6.11. Exceptions --------------------------------------------------------
325323

326324
; ---- 6.12. Environments and evaluation ---------------------------------------
@@ -331,34 +329,6 @@ parameterize ; is defined in srfi-39.ss
331329

332330
; ---- 6.13. Input and output --------------------------------------------------
333331

334-
(define (textual-port? x)
335-
(or (input-file-port? x)
336-
(input-string-port? x)
337-
(output-file-port? x)
338-
(output-string-port? x)
339-
(standard-port? x)))
340-
341-
(define (binary-port? x) #f)
342-
343-
(define (port? x)
344-
(or (input-port? x)
345-
(output-port? x)))
346-
347-
(define (input-port-open? x)
348-
(cond ((input-file-port? x)
349-
(input-file-port-open? x))
350-
((input-string-port? x) #t)
351-
((standard-input-port? x) #t)
352-
(else #f)))
353-
354-
(define (output-port-open? x)
355-
(cond ((output-file-port? x)
356-
(output-file-port-open? x))
357-
((output-string-port? x) #t)
358-
((standard-output-port? x) #t)
359-
((standard-error-port? x) #t)
360-
(else #f)))
361-
362332
(define current-input-port
363333
(make-parameter (standard-input-port)
364334
(lambda (x)
@@ -398,11 +368,6 @@ parameterize ; is defined in srfi-39.ss
398368
; TODO open-output-bytevector
399369
; TODO get-output-bytevector
400370

401-
(define (write-path path . x)
402-
(%write-path path (if (pair? x)
403-
(car x)
404-
(current-output-port))))
405-
406371
; TODO write-u8
407372
; TODO write-bytevector
408373

@@ -440,48 +405,13 @@ parameterize ; is defined in srfi-39.ss
440405
%current-dynamic-extents)
441406
(apply emergency-exit normally?))
442407

443-
; (dynamic-wind
444-
; (lambda () (display "before\n"))
445-
; (lambda () (exit))
446-
; (lambda () (display "after\n")))
447-
448408
; TODO get-environment-variable
449409
; TODO get-environment-variables
450410

451411
; TODO current-second
452412
; TODO current-jiffy
453413
; TODO jiffies-per-second
454414

455-
; ------------------------------------------------------------------------------
456-
; ... =>
457-
;
458-
;
459-
;
460-
;
461-
;
462-
;
463-
;
464-
;
465-
;
466-
; else
467-
;
468-
;
469-
; interaction-environment let-syntax
470-
; letrec-syntax
471-
;
472-
; null-environment
473-
;
474-
;
475-
;
476-
; scheme-report-environment
477-
;
478-
;
479-
;
480-
; syntax-rules
481-
;
482-
;
483-
; ------------------------------------------------------------------------------
484-
485415
(define interaction-environment
486416
(let ((e (fork/csc identity)))
487417
(lambda () e)))

basis/srfi-1.ss

+25-25
Original file line numberDiff line numberDiff line change
@@ -150,31 +150,31 @@
150150
; (define (cdar x) (cdr (car x)))
151151
; (define (cddr x) (cdr (cdr x)))
152152

153-
(define (caaar x) (car (car (car x))))
154-
(define (caadr x) (car (car (cdr x))))
155-
(define (cadar x) (car (cdr (car x))))
156-
(define (caddr x) (car (cdr (cdr x))))
157-
(define (cdaar x) (cdr (car (car x))))
158-
(define (cdadr x) (cdr (car (cdr x))))
159-
(define (cddar x) (cdr (cdr (car x))))
160-
(define (cdddr x) (cdr (cdr (cdr x))))
161-
162-
(define (caaaar x) (car (car (car (car x)))))
163-
(define (caaadr x) (car (car (car (cdr x)))))
164-
(define (caadar x) (car (car (cdr (car x)))))
165-
(define (caaddr x) (car (car (cdr (cdr x)))))
166-
(define (cadaar x) (car (cdr (car (car x)))))
167-
(define (cadadr x) (car (cdr (car (cdr x)))))
168-
(define (caddar x) (car (cdr (cdr (car x)))))
169-
(define (cadddr x) (car (cdr (cdr (cdr x)))))
170-
(define (cdaaar x) (cdr (car (car (car x)))))
171-
(define (cdaadr x) (cdr (car (car (cdr x)))))
172-
(define (cdadar x) (cdr (car (cdr (car x)))))
173-
(define (cdaddr x) (cdr (car (cdr (cdr x)))))
174-
(define (cddaar x) (cdr (cdr (car (car x)))))
175-
(define (cddadr x) (cdr (cdr (car (cdr x)))))
176-
(define (cdddar x) (cdr (cdr (cdr (car x)))))
177-
(define (cddddr x) (cdr (cdr (cdr (cdr x)))))
153+
; (define (caaar x) (car (car (car x))))
154+
; (define (caadr x) (car (car (cdr x))))
155+
; (define (cadar x) (car (cdr (car x))))
156+
; (define (caddr x) (car (cdr (cdr x))))
157+
; (define (cdaar x) (cdr (car (car x))))
158+
; (define (cdadr x) (cdr (car (cdr x))))
159+
; (define (cddar x) (cdr (cdr (car x))))
160+
; (define (cdddr x) (cdr (cdr (cdr x))))
161+
162+
; (define (caaaar x) (car (car (car (car x)))))
163+
; (define (caaadr x) (car (car (car (cdr x)))))
164+
; (define (caadar x) (car (car (cdr (car x)))))
165+
; (define (caaddr x) (car (car (cdr (cdr x)))))
166+
; (define (cadaar x) (car (cdr (car (car x)))))
167+
; (define (cadadr x) (car (cdr (car (cdr x)))))
168+
; (define (caddar x) (car (cdr (cdr (car x)))))
169+
; (define (cadddr x) (car (cdr (cdr (cdr x)))))
170+
; (define (cdaaar x) (cdr (car (car (car x)))))
171+
; (define (cdaadr x) (cdr (car (car (cdr x)))))
172+
; (define (cdadar x) (cdr (car (cdr (car x)))))
173+
; (define (cdaddr x) (cdr (car (cdr (cdr x)))))
174+
; (define (cddaar x) (cdr (cdr (car (car x)))))
175+
; (define (cddadr x) (cdr (cdr (car (cdr x)))))
176+
; (define (cdddar x) (cdr (cdr (cdr (car x)))))
177+
; (define (cddddr x) (cdr (cdr (cdr (cdr x)))))
178178

179179
(define (first x) (car x))
180180
(define (second x) (car (cdr x)))

0 commit comments

Comments
 (0)