Skip to content

Commit

Permalink
fix clause[*].expand
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStoryM committed Oct 5, 2021
1 parent f98a5d9 commit f7ef99b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions typed-racket-lib/typed-racket/base-env/prims.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ the typed racket language.
(begin-for-syntax
(define-values (define-for/hash:-variant define-for*/hash:-variant)
(let ()
(define ((make for/folder:) hash-maker)
(define ((make for*? for/folder:) hash-maker)
(lambda (stx)
(syntax-parse stx
[(_ a1:optional-standalone-annotation*
Expand All @@ -614,11 +614,13 @@ the typed racket language.
(quasisyntax/loc stx
(#,for/folder: : #,a.ty
((return-hash : #,a.ty (ann (#,hash-maker null) #,a.ty)))
(clause.expand ... ...)
(if for*?
(clause.expand* ... ...)
(clause.expand ... ...))
(let-values (((key val) (let () body ...)))
(hash-set return-hash key val))))])))

(values (make #'for/fold:) (make #'for*/fold:)))))
(values (make #f #'for/fold:) (make #t #'for*/fold:)))))

(define-syntax for/hash: (define-for/hash:-variant #'make-immutable-hash))
(define-syntax for/hasheq: (define-for/hash:-variant #'make-immutable-hasheq))
Expand Down

0 comments on commit f7ef99b

Please sign in to comment.