[racket] source locations of syntax objects in a required file

From: Alexander D. Knauth (alexander at knauth.org)
Date: Sun Mar 8 14:19:19 EDT 2015

If I have these files:
test.rkt:
#lang racket
(define stx #'here)
(syntax-source stx)
(syntax-line stx)
(syntax-column stx)
(syntax-position stx)
(syntax-span stx)
require-test.rkt:
#lang racket
(require "test.rkt")

Then when I run test.rkt, it prints:
#<path:/Users/Alex/Documents/DrRacket/srcloc/test.rkt>
2
14
28
4
As expected.  But when I run require-test.rkt, it prints:
#f
#f
#f
#f
0

What happened to the source locations?  Why is it doing this?


Posted on the users mailing list.