syntax/parse: trim txlifts helper module
This commit is contained in:
parent
0a7d97df86
commit
6fe55ec307
|
@ -1,14 +1,13 @@
|
|||
#lang racket/base
|
||||
(require (for-template racket/base))
|
||||
(provide txlift
|
||||
get-txlifts
|
||||
get-txlifts-as-definitions
|
||||
call/txlifts
|
||||
with-txlifts
|
||||
with-txlifts/defs)
|
||||
call/txlifts)
|
||||
|
||||
;; Like lifting definitions, but within a single transformer.
|
||||
|
||||
;; current-liftbox : Parameter of [#f or (Listof (list Id Stx))]
|
||||
(define current-liftbox (make-parameter #f))
|
||||
|
||||
(define (call/txlifts proc)
|
||||
|
@ -44,10 +43,3 @@
|
|||
(let ([v (proc)])
|
||||
(with-syntax ([((var rhs) ...) (get-txlifts)])
|
||||
#`(let* ([var rhs] ...) #,v))))))
|
||||
|
||||
(define (with-txlifts/defs proc)
|
||||
(call/txlifts
|
||||
(lambda ()
|
||||
(let ([v (proc)])
|
||||
(with-syntax ([(def ...) (get-txlifts-as-definitions)])
|
||||
#`(begin def ... #,v))))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user