From 7e634f3b66a246605f51dde29122c8c1d962efa0 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Thu, 18 Jun 2015 23:33:01 +0900 Subject: [PATCH] procedure-signature should strip synclos from parameters --- lib/chibi/type-inference.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/chibi/type-inference.scm b/lib/chibi/type-inference.scm index 407f456e..4e125672 100644 --- a/lib/chibi/type-inference.scm +++ b/lib/chibi/type-inference.scm @@ -305,13 +305,17 @@ ;;> remaining arguments are the parameter types. (define (procedure-signature x . o) + (define (map* f ls) + (cond ((pair? ls) (cons (f (car ls)) (map* f (cdr ls)))) + ((null? ls) '()) + (else (f ls)))) (define (ast-sig x) (cond ((lambda? x) (cons (lambda-return-type x) (if (pair? (lambda-param-types x)) (lambda-param-types x) - (lambda-params x)))) + (map* identifier->symbol (lambda-params x))))) ((seq? x) (ast-sig (last (seq-ls x)))) ((and (pair? x) (lambda? (car x))) (ast-sig (lambda-body (car x)))) ;; TODO: improve the type inference so this isn't needed