X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=typecheck.scm;h=55c2fd8201f2467ff3e136189412b6dc351780fd;hb=8aacba5976424791fb51d5d36118269d32c4096a;hp=21b874c2fdc043b41297575d84bdd12132d559a5;hpb=76d1cd698cc577eec3a259a6937b4ada324c1bfd;p=scheme.git diff --git a/typecheck.scm b/typecheck.scm index 21b874c..55c2fd8 100644 --- a/typecheck.scm +++ b/typecheck.scm @@ -57,11 +57,14 @@ (list 'lambda (lambda-args prog) (normalize (caddr prog))))) ((app? prog) (if (null? (cddr prog)) - (cons (normalize (car prog)) (normalize (cdr prog))) ; (f a) - (list (list (normalize (car prog)) (normalize (cadr prog))) (normalize (caddr prog))))) ; (f a b) + `(,(normalize (car prog)) ,(normalize (cadr prog))) ; (f a) + `(,(list (normalize (car prog)) (normalize (cadr prog))) + ,(normalize (caddr prog))))) ; (f a b) + ;; (list (list (normalize (car prog)) + ;; (normalize (cadr prog))) (normalize (caddr prog))))) ; (f a b) ((let? prog) (append (list 'let - (map (lambda (x) (cons (car x) (normalize (cdr x)))) + (map (lambda (x) `(,(car x) ,(normalize (cadr x)))) (let-bindings prog))) (map normalize (let-body prog)))) (else prog)))