Skip to content

Instantly share code, notes, and snippets.

@corpix
Created December 27, 2022 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corpix/e8756eea24f49bde850b95b15588b87e to your computer and use it in GitHub Desktop.
Save corpix/e8756eea24f49bde850b95b15588b87e to your computer and use it in GitHub Desktop.
#lang racket
(require (for-syntax racket))
(define-syntax (sample stx)
(syntax-case stx (file)
((_ (file path))
(let ((file (syntax->datum #'path)))
(call-with-input-string
(file->string file)
(lambda (port) (read-syntax file port)))))))
(sample (file "./sample.rkt"))
; ./sample.rkt::2: say-hello: unbound identifier;
; also, no #%app syntax transformer is bound
; at: say-hello
; in: (say-hello)
; Source locations:
; ./sample.rkt:1:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment