syntax-case, require, file

16 views
Skip to first unread message

kalime...@gmail.com

unread,
Feb 12, 2022, 2:24:18 PM2/12/22
to Racket Users
Why
(define-syntax (require-file stx)
  (syntax-case stx ()
    [(_ x)
     #'(require (file x))]))
doesn't work (it compiles, but doesn't import identifiers)?

(define-syntax (require-file* stx)
  (syntax-case stx ()
    [(_ x)
     #`(require #,(datum->syntax #'x (list #'file #'x)))]))
works fine.
Reply all
Reply to author
Forward
0 new messages