mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
(scheme write) library
This commit is contained in:
parent
335f3e86d5
commit
39e0f5c092
6 changed files with 19 additions and 6 deletions
5
Makefile
5
Makefile
|
@ -1,7 +1,7 @@
|
|||
TESTSCM = unit-tests
|
||||
TESTFILES = $(addprefix tests/, $(addsuffix .scm, $(TESTSCM)))
|
||||
|
||||
all: cyclone scheme/base.o scheme/read.o scheme/char.o scheme/eval.o icyc
|
||||
all: cyclone scheme/base.o scheme/read.o scheme/write.o scheme/char.o scheme/eval.o icyc
|
||||
|
||||
scheme/base.o: cyclone scheme/base.sld
|
||||
./cyclone scheme/base.sld
|
||||
|
@ -15,6 +15,9 @@ scheme/eval.o: cyclone scheme/eval.sld
|
|||
scheme/read.o: cyclone scheme/read.sld
|
||||
./cyclone scheme/read.sld
|
||||
|
||||
scheme/write.o: cyclone scheme/write.sld
|
||||
./cyclone scheme/write.sld
|
||||
|
||||
trans.so: trans.scm
|
||||
csc -s trans.scm
|
||||
|
||||
|
|
1
icyc.scm
1
icyc.scm
|
@ -7,6 +7,7 @@
|
|||
(import (scheme base)
|
||||
(scheme char)
|
||||
(scheme read)
|
||||
(scheme write)
|
||||
(scheme eval))
|
||||
(cond-expand
|
||||
(cyclone
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
current-output-port
|
||||
;current-input-port
|
||||
;current-error-port
|
||||
write ;; TODO: move to (scheme write) library
|
||||
error
|
||||
raise
|
||||
raise-continuable
|
||||
|
@ -285,10 +284,6 @@
|
|||
(error "bad parameter syntax"))))))
|
||||
(define current-output-port
|
||||
(make-parameter (Cyc-stdout)))
|
||||
(define (write obj . port)
|
||||
(if (null? port)
|
||||
(Cyc-write obj (current-output-port))
|
||||
(Cyc-write obj (car port))))
|
||||
(define (error msg . args)
|
||||
(raise (cons msg args)))
|
||||
(define (raise obj)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
(define-library (scheme eval)
|
||||
(import
|
||||
(scheme base)
|
||||
(scheme write)
|
||||
(scheme read))
|
||||
(export
|
||||
eval
|
||||
|
|
12
scheme/write.sld
Normal file
12
scheme/write.sld
Normal file
|
@ -0,0 +1,12 @@
|
|||
(define-library (scheme write)
|
||||
(export
|
||||
write
|
||||
)
|
||||
(import (scheme base))
|
||||
(begin
|
||||
(define (write obj . port)
|
||||
(if (null? port)
|
||||
(Cyc-write obj (current-output-port))
|
||||
(Cyc-write obj (car port))))
|
||||
)
|
||||
)
|
|
@ -1,5 +1,6 @@
|
|||
(import (scheme base)
|
||||
(scheme char)
|
||||
(scheme write)
|
||||
(scheme eval))
|
||||
|
||||
(define *num-passed* 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue