Improve Racket supporting code

This commit is contained in:
foss-mc 2020-08-28 19:02:04 +08:00 committed by GitHub
parent 17b3bb8d3d
commit 979424c8e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,8 @@
(define (blodwen-os)
(cond
[(eq? (system-type 'os) 'unix) "unix"]
[(eq? (system-type 'os) 'osx) "darwin"]
[(eq? (system-type 'os) 'windows) "windows"]
(case (system-type 'os)
[(unix) "unix"]
[(osx) "darwin"]
[(windows) "windows"]
[else "unknown"]))
(define blodwen-read-args (lambda (desc)
@ -59,8 +59,8 @@
(if (= (vector-ref xs 0) 0)
'()
(cons (vector-ref xs 1) (from-idris-list (vector-ref xs 2)))))
(define (string-concat xs) (apply string-append (from-idris-list xs)))
(define (string-pack xs) (apply string (from-idris-list xs)))
(define (string-concat xs) (string-join (from-idris-list xs) ""))
(define (string-pack xs) (list->string (from-idris-list xs)))
(define string-cons (lambda (x y) (string-append (string x) y)))
(define get-tag (lambda (x) (vector-ref x 0)))
(define string-reverse (lambda (x)
@ -92,7 +92,7 @@
(if (eof-object? str)
""
str))
void))
(void)))
(define (blodwen-get-char p)
(if (port? p)
@ -100,7 +100,7 @@
(if (eof-object? chr)
#\nul
chr))
void))
(void)))
;; Buffers