add `strip-bindings` and `replace-bindings`

dev-srcloc
Matthew Butterick 8 years ago
parent 0bc28672f9
commit 54f1703eb2

@ -447,3 +447,14 @@ Create a new identifier within the lexical context of @racket[id] with the same
foo% foo%
] ]
} }
@(require (for-label syntax/strip-context))
@defproc[(strip-bindings [stx syntax?]) syntax?]{
Removes all bindings from @racket[stx], but preserves
source-location information and properties. An alias for @racket[strip-context].}
@defproc[(replace-bindings [stx-source (or/c syntax? #f)] [stx-target syntax?]) syntax?]{
Uses the bindings from @racket[stx-source] to replace the bindings of all parts of @racket[stx-target], while preserving source-location
information and properties. An alias for @racket[replace-context].}

@ -7,7 +7,8 @@
br/private/syntax-flatten) br/private/syntax-flatten)
(provide (all-defined-out) (provide (all-defined-out)
syntax-flatten syntax-flatten
(all-from-out syntax/strip-context)) (rename-out [strip-context strip-bindings]
[replace-context replace-bindings]))
(module+ test (module+ test
(require rackunit)) (require rackunit))

Loading…
Cancel
Save