no title added by buhman on Mon Dec 3 10:04:28 2018

(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)))))))

#;456> (test foo (make-foo 1 2))
(1 2)
#;460> (define my-type 'foo)
#;476> (test my-type (make-foo 1 2))

Error: unbound variable: my-type-x