aboutsummaryrefslogtreecommitdiffstats
path: root/csc
diff options
context:
space:
mode:
Diffstat (limited to 'csc')
-rw-r--r--csc/ir1.csc12
-rw-r--r--csc/macros-test.csc10
-rw-r--r--csc/macros.csc12
3 files changed, 11 insertions, 23 deletions
diff --git a/csc/ir1.csc b/csc/ir1.csc
index e5fc2dd..ab60fc9 100644
--- a/csc/ir1.csc
+++ b/csc/ir1.csc
@@ -54,11 +54,9 @@
make-library-define
make-library-ref
make-sequence
- make-void
sequence-head
sequence-tail
- sequence?
- void?)
+ sequence?)
(import (scheme base)
(only (csc loop) loop return))
(begin
@@ -67,13 +65,6 @@
; Tree-IL).
- ; <void>
- ; An empty expression. In practice, equivalent to Scheme's (if #f #f).
- (define-record-type <void>
- (make-void)
- void?)
-
-
; <constant> expression
; Constant is used to include literal constants in scheme code.
(define-record-type <constant>
@@ -212,7 +203,6 @@
(define (ir1=?-sametype x y)
(cond
- ((and (void? x) (void? y)) #t)
((and (constant? x) (constant? y))
(equal? (constant-expression x) (constant-expression y)))
((and (lexical-ref? x) (lexical-ref? y))
diff --git a/csc/macros-test.csc b/csc/macros-test.csc
index 6211131..92fda88 100644
--- a/csc/macros-test.csc
+++ b/csc/macros-test.csc
@@ -9,11 +9,11 @@
lexical-set-name
lexical-set?
make-constant
- make-lexical-ref
make-lambda-case
make-letrec
+ make-lexical-ref
make-library-ref
- void?)
+ make-sequence)
(only (csc testing)
assert-equal
test)
@@ -180,8 +180,8 @@
(test builtin-case-lambda-cases
(assert-equal ir1=?
- (make-lambda-case '(x y z) #f #f (make-sequence (make-void) (make-constant 5))
- (make-lambda-case '(a b c) 'd #f (make-sequence (make-void) (make-constant 6)) '()))
+ (make-lambda-case '(x y z) #f #f (make-sequence (make-constant #f) (make-constant 5))
+ (make-lambda-case '(a b c) 'd #f (make-sequence (make-constant #f) (make-constant 6)) '()))
(expand
'(case-lambda
((x y z) (quote 5))
@@ -195,7 +195,7 @@
(make-letrec #t '(a b) #f
(list (make-constant 6)
(make-lexical-ref 'a #f))
- (make-sequence (make-void) (make-constant 7))))
+ (make-sequence (make-constant #f) (make-constant 7))) '())
(expand
'(case-lambda
((x)
diff --git a/csc/macros.csc b/csc/macros.csc
index 0b59b84..2c9c755 100644
--- a/csc/macros.csc
+++ b/csc/macros.csc
@@ -40,11 +40,9 @@
make-library-define
make-library-ref
make-sequence
- make-void
sequence-head
sequence-tail
- sequence?
- void?)
+ sequence?)
(only (csc list)
revappend
unzip)
@@ -656,7 +654,7 @@
(define (expand-lambda-body-rest body)
(let loop ((body body)
- (expanded-body (make-void)))
+ (expanded-body (make-constant #f)))
(syntax-case body
('()
expanded-body)
@@ -677,8 +675,8 @@
(syntax-case body
('()
(if (null? names)
- (make-void)
- (make-letrec #t names gensyms expressions (make-void))))
+ (make-constant #f)
+ (make-letrec #t (reverse names) (reverse gensyms) (reverse expressions) (make-constant #f))))
((expr . expr*)
(define expanded-expr (expand-syntax-object expr))
(cond
@@ -697,7 +695,7 @@
(else
(if (null? names)
(expand-lambda-body-rest body)
- (make-letrec #t names gensyms expressions (expand-lambda-body-rest body)))))))))
+ (make-letrec #t (reverse names) (reverse gensyms) (reverse expressions) (expand-lambda-body-rest body)))))))))
(define (case-lambda-helper form)