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:
Ryan Culpepper 2016-05-03 02:27:33 -04:00
parent c8f3536694
commit 430e6e9567

View File

@ -399,7 +399,7 @@
;; combine-pattern+sides : Pattern (listof SideClause) -> Pattern
(define (combine-pattern+sides pattern sides splicing?)
(define sides-group (gensym))
(define sides-group (gensym*))
(define actions-pattern
(create-action:and
(for/list ([side (in-list sides)] [index (in-naturals)])
@ -428,6 +428,13 @@
(create-pat:and (list pattern dummy-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