From 32542de937bbb815419df99aeef0beebe7e0e8c1 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 5 Jun 2019 08:03:13 -0600 Subject: [PATCH] doc clarification for `syntax-source-module` --- pkgs/racket-doc/scribblings/reference/filesystem.scrbl | 4 +++- pkgs/racket-doc/scribblings/reference/stx-ops.scrbl | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/racket-doc/scribblings/reference/filesystem.scrbl b/pkgs/racket-doc/scribblings/reference/filesystem.scrbl index 1a6cc7dffd..bd6e573c4d 100644 --- a/pkgs/racket-doc/scribblings/reference/filesystem.scrbl +++ b/pkgs/racket-doc/scribblings/reference/filesystem.scrbl @@ -777,7 +777,9 @@ follows from the @racket[define-runtime-path] syntactic form: determined by preserving the original expression as a syntax object, extracting its source module path at run time (again using @racket[syntax-source-module]), and then resolving the - resulting module path index.} + resulting module path index. Note that @racket[syntax-source-module] + is based on a syntax object's @tech{lexical information}, not its + source location.} @item{If the expression has no source module, the @racket[syntax-source] location associated with the form is diff --git a/pkgs/racket-doc/scribblings/reference/stx-ops.scrbl b/pkgs/racket-doc/scribblings/reference/stx-ops.scrbl index 4d993c32ad..472c28de6b 100644 --- a/pkgs/racket-doc/scribblings/reference/stx-ops.scrbl +++ b/pkgs/racket-doc/scribblings/reference/stx-ops.scrbl @@ -104,7 +104,11 @@ can be inferred from its lexical context. If @racket[source?] is @racket[#f], then result is a module path index or symbol (see @secref["modpathidx"]) or a @tech{resolved module path}; if @racket[source?] is true, the result is a path or symbol corresponding to the loaded module's -source in the sense of @racket[current-module-declare-source].} +source in the sense of @racket[current-module-declare-source]. + +Note that @racket[syntax-source-module] does @emph{not} consult the +source location of @racket[stx]. The result is based on the +@tech{lexical information} of @racket[stx].} @defproc[(syntax-e [stx syntax?]) any]{