add type check guards to comparators

This commit is contained in:
Yuichi Nishiwaki 2014-07-17 13:58:08 +09:00
parent bb9be2c628
commit e5511027e8
1 changed files with 12 additions and 4 deletions

View File

@ -113,8 +113,12 @@
(dictionary-set! cache sym id)
id)))
(define (compare sym1 sym2)
(identifier=? use-env sym1 use-env sym2))
(define (compare x y)
(if (not (symbol? x))
#f
(if (not (symbol? y))
#f
(identifier=? use-env x use-env y))))
(f expr rename compare)))
@ -161,8 +165,12 @@
(dictionary-set! cache sym id)
id)))
(define (compare sym1 sym2)
(identifier=? mac-env sym1 mac-env sym2))
(define (compare x y)
(if (not (symbol? x))
#f
(if (not (symbol? y))
#f
(identifier=? mac-env x mac-env y))))
(unwrap (f (wrap expr) inject compare))))