Skip to content

Commit 26351c5

Browse files
iitalicsAlexKnauth
authored andcommitted
Use scoped-binding-introducer to hide delta-introducer details
1 parent 38d3c06 commit 26351c5

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
@@ -331,7 +332,7 @@
331332
; forms), it searches for a `binding-declaration` and fills in `internal-id` with the
332333
; actual definition. The `type` field is used as the expected type of the definition.
333334
; fixity : [Maybe Fixity]
334-
(struct binding-declaration [internal-id type delta-syntax fixity]
335+
(struct binding-declaration [internal-id type scoped-binding-introducer fixity]
335336
#:property prop:procedure
336337
(λ (this stx)
337338
(match-define (binding-declaration x- type _ _) this)
@@ -342,11 +343,11 @@
342343
(define-syntax-class id/binding-declaration
343344
#:attributes [internal-id type scoped-binding-introducer fixity]
344345
[pattern (~var x (local-value binding-declaration?))
345-
#:do [(match-define (binding-declaration x-* type* delta* fixity*)
346+
#:do [(match-define (binding-declaration x-* type* sbi* fixity*)
346347
(attribute x.local-value))]
347348
#:attr internal-id (syntax-local-introduce x-*)
348349
#:with type (syntax-local-introduce type*)
349-
#:attr scoped-binding-introducer (make-syntax-delta-introducer delta* #'_)
350+
#:attr scoped-binding-introducer (deserialize-syntax-introducer sbi*)
350351
#:attr fixity fixity*]))
351352

352353
(define-syntax-parser define/binding-declaration
@@ -403,26 +404,25 @@
403404
; will be understood by `def`.
404405
[_
405406
(syntax-parse stx
406-
[(_ x:id t_unexpanded:expr
407+
[(_ x:id {~type t:type}
407408
{~alt {~optional {~and #:exact exact?}}
408409
{~optional f:fixity-annotation}}
409410
...)
410411
#:with x- (generate-temporary #'x)
411412
#:with exct? (and (attribute exact?) #true)
412413
#:with fixity (attribute f.fixity)
413-
#:with {~type t:type} #'t_unexpanded
414414
#:with t_reduced (if (attribute exact?)
415415
#'t.expansion
416416
(type-reduce-context #'t.expansion))
417-
#:with delta (syntax-local-introduce
418-
((attribute t.scoped-binding-introducer) #'_))
417+
#:with sbi (serialize-syntax-introducer
418+
(attribute t.scoped-binding-introducer))
419419
#`(begin-
420420
(define-values- [] t.residual)
421421
(define-syntax- x
422422
(binding-declaration
423423
(quote-syntax x-)
424424
(quote-syntax t_reduced)
425-
(quote-syntax delta)
425+
(quote-syntax sbi)
426426
'fixity)))])])))
427427

428428
(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)