diff --git a/Makefile b/Makefile index 7f4fd0f..b83bcdd 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,8 @@ test-r6rs: mkdir -p test mkdir -p test/snow mkdir -p test/snow/foo - echo "(library (foo bar) (export baz) (import (rnrs)) (define baz (lambda () (display \"Test successfull\") (newline))))" > test/snow/foo/bar.sls - echo "(import (rnrs) (foo bar)) (baz)" > test/main.sps + printf "#!r6rs\n(library (foo bar) (export baz) (import (rnrs)) (define baz (lambda () (display \"Test successfull\") (newline))))" > test/snow/foo/bar.sls + printf "#!r6rs\n(import (rnrs) (foo bar)) (baz)" > test/main.sps cd test && COMPILE_R7RS=${COMPILE_R7RS} compile-r7rs -I ./snow -o main main.sps -cd test && ./main > /tmp/compile-r7rs-test-result.txt 2>&1 @grep "Test successfull" /tmp/compile-r7rs-test-result.txt || (echo "Test failed, output: " && cat /tmp/compile-r7rs-test-result.txt && exit 1) diff --git a/libs/data.sld b/libs/data.sld index 9382e01..43ac6f3 100644 --- a/libs/data.sld +++ b/libs/data.sld @@ -417,6 +417,8 @@ (let ((rkt-input-file (if (string=? input-file "") "" (change-file-suffix input-file ".rkt")))) + (if r6rs? + #t (when (not (string=? rkt-input-file "")) (when (file-exists? rkt-input-file) (delete-file rkt-input-file)) @@ -430,7 +432,7 @@ (display "(include \"") (display (path->filename input-file)) (display "\")") - (newline)))) + (newline))))) (apply string-append `("racket" " " @@ -447,7 +449,8 @@ (string-append "-S " item " ")) append-directories) " " - ,(if r6rs? input-file rkt-input-file))))))) + ,(if r6rs? input-file rkt-input-file) + )))))) (sagittarius (type . interpreter) (command . ,(lambda (input-file output-file prepend-directories append-directories library-files r6rs?)