From 8ec9bf72d796123730c92d81fdc8df6ab21535eb Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 2 Dec 2020 17:24:16 -0700 Subject: [PATCH] docs: clarify which compiled-code literals go through `datum-intern-literal` it's only strings and byte strings. --- pkgs/racket-doc/scribblings/reference/printer.scrbl | 8 +++++++- pkgs/racket-doc/scribblings/reference/reader.scrbl | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/racket-doc/scribblings/reference/printer.scrbl b/pkgs/racket-doc/scribblings/reference/printer.scrbl index 3f4ef2be72..5210080463 100644 --- a/pkgs/racket-doc/scribblings/reference/printer.scrbl +++ b/pkgs/racket-doc/scribblings/reference/printer.scrbl @@ -588,6 +588,12 @@ identifier; those functions lead to top-level and module variables with @tech{unreadable symbol}ic names, and the names are deterministic as long as expansion is otherwise deterministic. +When a compiled-form object has string and byte string literals, they +are @tech{interned} using @racket[datum-intern-literal] when the +compiled-object for is read back in. Numbers and other values that +@racket[read-syntax] would intern, however, are not interned when read +back as quoted literals in a compiled object. + A compiled form may contain path literals. Although paths are not normally printed in a way that can be read back in, path literals can be written and read as part of compiled code. The @@ -618,7 +624,7 @@ the conversion of the source field is to preserve some source information but not expose or record a path that makes no sense on a different filesystem or platform. -For internal testing purposes, when the +For internal testing purposes in the 3m and CGC variants of Racket, when the @as-index{@envvar{PLT_VALIDATE_LOAD}} environment variable is set, the reader runs a validator on bytecode parsed from @litchar{#~}. The validator may catch miscompilations or bytecode-file corruption. The diff --git a/pkgs/racket-doc/scribblings/reference/reader.scrbl b/pkgs/racket-doc/scribblings/reference/reader.scrbl index 77489683cd..519208e6d1 100644 --- a/pkgs/racket-doc/scribblings/reference/reader.scrbl +++ b/pkgs/racket-doc/scribblings/reference/reader.scrbl @@ -43,10 +43,13 @@ numbers produced by the reader in @racket[read-syntax] mode are @deftech{interned}, which means that such values in the result of @racket[read-syntax] are always @racket[eq?] when they are @racket[equal?] (whether from the same call or different calls to -@racket[read-syntax]). Symbols and keywords are @tech{interned} in -both @racket[read] and @racket[read-syntax] mode. Sending an -@tech{interned} value across a @tech{place channel} does not -necessarily produce an @tech{interned} value at the receiving +@racket[read-syntax]). Symbols and keywords are interned in +both @racket[read] and @racket[read-syntax] mode. When a quoted value +is in compiled code that written and then read back in (see +@secref["print-compiled"]), only strings and byte strings are +interned when reading the code. Sending an +interned value across a @tech{place channel} does not +necessarily produce an interned value at the receiving @tech{place}. See also @racket[datum-intern-literal] and @racket[datum->syntax].