Small bug fixes in traversal.hl.rkt and free-identifier-tree-equal.rkt

This commit is contained in:
Georges Dupéron 2017-03-20 16:11:01 +01:00
parent 9814513b47
commit dad01aa118
2 changed files with 5 additions and 3 deletions

View File

@ -62,12 +62,14 @@
(rec=? (struct->list a) (rec=? (struct->list a)
(struct->list b)))))] (struct->list b)))))]
[(struct? a) [(struct? a)
(rec=? (vector->immutable-vector (struct->vector a)))] (and (struct? b)
(rec=? (vector->immutable-vector (struct->vector a))
(vector->immutable-vector (struct->vector b))))]
[(null? a) (null? b)] [(null? a) (null? b)]
[else (equal? a b)])) [else (equal? a b)]))
(define/contract ((free-id-tree-hash default-hc) a [hc default-hc]) (define/contract ((free-id-tree-hash default-hc) a [hc default-hc])
(-> (-> any/c fixnum?) (-> isyntax/c (-> isyntax/c fixnum?) fixnum?)) (-> (-> any/c fixnum?) (->* {isyntax/c} {(-> isyntax/c fixnum?)} fixnum?))
(define rec-hash (free-id-tree-hash hc)) (define rec-hash (free-id-tree-hash hc))
(cond (cond
[(identifier? a) (hc (syntax-e #'a))] [(identifier? a) (hc (syntax-e #'a))]

View File

@ -17,7 +17,7 @@
values) values)
(only-in racket/base values) (only-in racket/base values)
(subtract-in racket/contract typed/racket/base) (subtract-in racket/contract typed/racket/base)
phc-toolkit (except-in phc-toolkit generate-temporary)
phc-toolkit/untyped-only phc-toolkit/untyped-only
remember)) remember))
@(unless-preexpanding @(unless-preexpanding