HomeAboutCodePastes

Paste on 2021-02-09T16:39:55

(import (only compile-file compile-file)
        (only chicken.file create-temporary-file))
(define (compile sexp)
  (let ((tempf (chicken.file#create-temporary-file)))
    (call-with-output-file tempf (cut write `(define (ev) ,sexp) <>))
    ;; (call-with-output-file tempf (cut write sexp <>))
    (compile-file#compile-file tempf #:options '("-cc" "tcc" "-ld" "tcc"))
    ;; (scheme#eval '(ev))
    (ev)
    ;; (void)
    ))

(define eval compile)

plain