syntax/parse: different fix for deterministic compilation
The previous fix (1acaf011
) caused a performance regression
(compilation time?), reported by stchang. Reverting to quote.
Apparently, the problem with gensym and deterministic compilation
isn't the uninterned-ness; it's the global counter used for the
name. So use a compilation-local counter instead.
This commit is contained in:
parent
c8f3536694
commit
430e6e9567
|
@ -399,7 +399,7 @@
|
||||||
|
|
||||||
;; combine-pattern+sides : Pattern (listof SideClause) -> Pattern
|
;; combine-pattern+sides : Pattern (listof SideClause) -> Pattern
|
||||||
(define (combine-pattern+sides pattern sides splicing?)
|
(define (combine-pattern+sides pattern sides splicing?)
|
||||||
(define sides-group (gensym))
|
(define sides-group (gensym*))
|
||||||
(define actions-pattern
|
(define actions-pattern
|
||||||
(create-action:and
|
(create-action:and
|
||||||
(for/list ([side (in-list sides)] [index (in-naturals)])
|
(for/list ([side (in-list sides)] [index (in-naturals)])
|
||||||
|
@ -428,6 +428,13 @@
|
||||||
(create-pat:and (list pattern dummy-pattern)))
|
(create-pat:and (list pattern dummy-pattern)))
|
||||||
pattern))
|
pattern))
|
||||||
|
|
||||||
|
;; gensym* : -> UninternedSymbol
|
||||||
|
;; Like gensym, but with deterministic name from compilation-local counter.
|
||||||
|
(define gensym*-counter 0)
|
||||||
|
(define (gensym*)
|
||||||
|
(set! gensym*-counter (add1 gensym*-counter))
|
||||||
|
(string->uninterned-symbol (format "group~a" gensym*-counter)))
|
||||||
|
|
||||||
;; ----
|
;; ----
|
||||||
|
|
||||||
;; parse-single-pattern : stx DeclEnv -> SinglePattern
|
;; parse-single-pattern : stx DeclEnv -> SinglePattern
|
||||||
|
|
Loading…
Reference in New Issue
Block a user