Use string->uninterned-symbol instead of gensym

The reason these functions used gensym to begin with
was that fresh variables resulted in confusing error
messages of the form "Expected a, but got a".

An upcoming commit fixes these error messages, so
the gensym is replaced.
This commit is contained in:
Asumu Takikawa 2013-10-16 14:36:06 -04:00
parent e243106294
commit b214fa01c1

View File

@ -750,6 +750,11 @@
(list syms (Poly-body* syms t))))
(list nps bp)))])))
;; Helper for fresh match expanders below, creates a
;; fresh name that prints the same as the original
(define (fresh-name sym)
(string->uninterned-symbol (symbol->string sym)))
;; This match expander creates new fresh names for exploring the body
;; of the polymorphic type. When lexical scoping of type variables is a concern, you
;; should use this form.
@ -761,7 +766,7 @@
(app (lambda (t)
(let* ([n (Poly-n t)]
[syms (hash-ref name-table t (lambda _ (build-list n (lambda _ (gensym)))))]
[fresh-syms (map gensym syms)])
[fresh-syms (map fresh-name syms)])
(list syms fresh-syms (Poly-body* fresh-syms t))))
(list nps freshp bp)))])))