Created
June 30, 2022 19:39
-
-
Save samth/e02678940bc4090f592344432e92e4a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require (for-meta 2 racket/base racket/file)) | |
(define-syntax (define-compile-time-bytes stx) | |
(syntax-case stx () | |
[(_ id f) | |
#`(begin | |
(begin-for-syntax | |
(define-syntax (gen _) | |
(datum->syntax #'here (file->bytes f)))) | |
(define-syntax (id stx) | |
#`(quote #,(gen))))])) | |
(define-compile-time-bytes x "/tmp/compile-time.rkt") | |
x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment