Skip to content

Commit f187930

Browse files
iitalicsAlexKnauth
authored andcommitted
Use scoped-binding-introducer to hide delta-introducer details
1 parent efbfc4a commit f187930

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

hackett-lib/hackett/private/base.rkt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
syntax/intdef
88
syntax/srcloc
99
syntax/parse/class/local-value
10-
threading)
10+
threading
11+
serialize-syntax-introducer)
1112
(postfix-in - (combine-in racket/base
1213
racket/promise))
1314
racket/stxparam
@@ -313,7 +314,7 @@
313314
; forms), it searches for a `binding-declaration` and fills in `internal-id` with the
314315
; actual definition. The `type` field is used as the expected type of the definition.
315316
; fixity : [Maybe Fixity]
316-
(struct binding-declaration [internal-id type delta-syntax fixity]
317+
(struct binding-declaration [internal-id type scoped-binding-introducer fixity]
317318
#:property prop:procedure
318319
(λ (this stx)
319320
(match-define (binding-declaration x- type _ _) this)
@@ -324,11 +325,11 @@
324325
(define-syntax-class id/binding-declaration
325326
#:attributes [internal-id type scoped-binding-introducer fixity]
326327
[pattern (~var x (local-value binding-declaration?))
327-
#:do [(match-define (binding-declaration x-* type* delta* fixity*)
328+
#:do [(match-define (binding-declaration x-* type* sbi* fixity*)
328329
(attribute x.local-value))]
329330
#:attr internal-id (syntax-local-introduce x-*)
330331
#:with type (syntax-local-introduce type*)
331-
#:attr scoped-binding-introducer (make-syntax-delta-introducer delta* #'_)
332+
#:attr scoped-binding-introducer (deserialize-syntax-introducer sbi*)
332333
#:attr fixity fixity*]))
333334

334335
(define-syntax-parser define/binding-declaration
@@ -385,26 +386,25 @@
385386
; will be understood by `def`.
386387
[_
387388
(syntax-parse stx
388-
[(_ x:id t_unexpanded:expr
389+
[(_ x:id {~type t:type}
389390
{~alt {~optional {~and #:exact exact?}}
390391
{~optional f:fixity-annotation}}
391392
...)
392393
#:with x- (generate-temporary #'x)
393394
#:with exct? (and (attribute exact?) #true)
394395
#:with fixity (attribute f.fixity)
395-
#:with {~type t:type} #'t_unexpanded
396396
#:with t_reduced (if (attribute exact?)
397397
#'t.expansion
398398
(type-reduce-context #'t.expansion))
399-
#:with delta (syntax-local-introduce
400-
((attribute t.scoped-binding-introducer) #'_))
399+
#:with sbi (serialize-syntax-introducer
400+
(attribute t.scoped-binding-introducer))
401401
#`(begin-
402402
(define-values- [] t.residual)
403403
(define-syntax- x
404404
(binding-declaration
405405
(quote-syntax x-)
406406
(quote-syntax t_reduced)
407-
(quote-syntax delta)
407+
(quote-syntax sbi)
408408
'fixity)))])])))
409409

410410
(define-syntax-parser λ1

hackett-lib/info.rkt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"curly-fn-lib"
88
"data-lib"
99
"syntax-classes-lib"
10-
"threading-lib"))
10+
"threading-lib"
11+
"serialize-syntax-introducer"))
1112
(define build-deps
1213
'())

0 commit comments

Comments
 (0)