diff --git a/Makefile b/Makefile index 18646139..4057a49f 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,9 @@ scheme/read.o: cyclone scheme/read.sld parser.scm scheme/write.o: cyclone scheme/write.sld ./cyclone scheme/write.sld +util.so: util.scm + csc -s util.scm + transforms.so: transforms.scm csc -s transforms.scm @@ -53,7 +56,7 @@ debug: debug2: libcyclone.so.1 gcc test.c -L. -lcyclone -I. -g -o test -cyclone: cyclone.scm transforms.so cgen.so libraries.so parser.so libcyclone.a +cyclone: cyclone.scm transforms.so util.so cgen.so libraries.so parser.so libcyclone.a csc cyclone.scm .PHONY: test diff --git a/cyclone.scm b/cyclone.scm index 267c1570..cb7026e5 100644 --- a/cyclone.scm +++ b/cyclone.scm @@ -17,6 +17,7 @@ (require-extension chicken-syntax) ;; when (require-extension srfi-1) ;; every (load (string-append (cyc:get-lib-dir) "parser.so")) + (load (string-append (cyc:get-lib-dir) "util.so")) (load (string-append (cyc:get-lib-dir) "libraries.so")) (load (string-append (cyc:get-lib-dir) "transforms.so")) (load (string-append (cyc:get-lib-dir) "cgen.so"))) @@ -26,6 +27,7 @@ ; ) (else (load (string-append (cyc:get-lib-dir) "parser.scm")) + (load (string-append (cyc:get-lib-dir) "util.scm")) (load (string-append (cyc:get-lib-dir) "libraries.scm")) (load (string-append (cyc:get-lib-dir) "transforms.scm")) (load (string-append (cyc:get-lib-dir) "cgen.scm")))) diff --git a/transforms.scm b/transforms.scm index ab1d6475..c950f791 100644 --- a/transforms.scm +++ b/transforms.scm @@ -190,11 +190,6 @@ (define (void) (if #f #t))) (else #f)) -; tagged-list? : symbol value -> boolean -(define (tagged-list? tag l) - (and (pair? l) - (eq? tag (car l)))) - ; char->natural : char -> natural (define (char->natural c) (let ((i (char->integer c))) diff --git a/util.scm b/util.scm new file mode 100644 index 00000000..870e22d5 --- /dev/null +++ b/util.scm @@ -0,0 +1,5 @@ + +(define (tagged-list? tag exp) + (if (pair? exp) + (equal? (car exp) tag) + #f))