(define-record-type foo (make-foo x y) foo? (x foo-x) (y foo-y)) (define-syntax test (ir-macro-transformer (lambda (exp inject compare) (let* ((type (cadr exp)) (body (cddr exp)) (get-x (inject (symbol-append (strip-syntax type) '- (strip-syntax 'x)))) (get-y (inject (symbol-append (strip-syntax type) '- (strip-syntax 'y))))) `(let ((thing ,@body)) (list (,get-x thing) (,get-y thing))))))) (begin-for-syntax (define my-type 'foo)) ;; She's just my type (define-syntax test-outer (ir-macro-transformer (lambda (exp inject compare) (let ((body (cdr exp))) `(test ,my-type ,@body))))) (print (test-outer (make-foo 1 2)))