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

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

@ -446,4 +446,15 @@ Create a new identifier within the lexical context of @racket[id] with the same
(define-% foo 42)
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)
(provide (all-defined-out)
syntax-flatten
(all-from-out syntax/strip-context))
(rename-out [strip-context strip-bindings]
[replace-context replace-bindings]))
(module+ test
(require rackunit))

Loading…
Cancel
Save