I'm trying to write a provide transformer that wraps a provided
identifier and then provides that instead.

For example,
#lang racket
(require (for-syntax syntax/parse racket/provide-transform))

(define-syntax wrapped-out
  (make-provide-pre-transformer
   (lambda (stx modes)
     (syntax-parse stx
       [(_ f)
        #:with wrapped-f
                (syntax-local-lift-expression
                 #'(lambda args (display "applying ") (displayln 'f)
(apply f args)))
        (pre-expand-export
         #'(rename-out [wrapped-f f]) modes)]))))

(provide (wrapped-out +))

A program requiring my module and using addition will print "applying +".

But I actually want to wrap f with a macro. Is this possible? (Is this
an XY problem?)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to