scheme types need not store their indices

This commit is contained in:
2026-03-21 16:26:32 -07:00
parent 9b8a7953dd
commit c6835b9dfe
2 changed files with 15 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
; (define $IORes (lambda (nm-1 nm-2) (vector 0 #f nm-1 nm-2)))
(define $IORes (lambda (nm-1 nm-2) (cons nm-1 nm-2)))
(define ($Left x) (vector 0 #f #f x))
(define ($Right x) (vector 1 #f #f x))
(define ($Left x) (vector 0 x))
(define ($Right x) (vector 1 x))
(define $LT 0)
(define $EQ 1)
(define $GT 2)
@@ -65,7 +65,9 @@
;; Actually should return unit..
(define (Data.IORef.primWriteIORef _ ref a) (lambda (w) ($IORes (set-box! ref a) w)))
(define (Node.readLine w)
($IORes ($Right (get-line (current-input-port))) w))
(case (get-line (current-input-port))
(#!eof ($IORes ($Left "EOF") w))
(else ($IORes ($Right (get-line (current-input-port))) w))))
(define (Prelude.subInt a b) (- a b))
(define (Prelude.jsEq _ a b) (= a b))
(define (Prelude.divInt a b) (fx/ a b))