Commit 98b78054 authored by ehuelsmann@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar ehuelsmann@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

Fix #161: READTABLE-CASE setting of *readtable* affects FASL content.

Note: Fix based on research by Alessio Stalla.
parent 43f1065a
...@@ -5847,4 +5847,17 @@ public final class Primitives { ...@@ -5847,4 +5847,17 @@ public final class Primitives {
} }
}; };
private static final Primitive GET_FASL_READTABLE
= new pf_get_fasl_readtable();
private static class pf_get_fasl_readtable extends Primitive {
pf_get_fasl_readtable() {
super("get-fasl-readtable", PACKAGE_SYS, false);
}
@Override
public LispObject execute() {
return FaslReadtable.getInstance();
}
}
} }
...@@ -120,6 +120,12 @@ ...@@ -120,6 +120,12 @@
(t (t
(%stream-output-object object stream)))) (%stream-output-object object stream))))
(defvar *the-fasl-printer-readtable*
(copy-readtable (get-fasl-readtable))
"This variable holds a copy of the FASL readtable which we need to bind
below, in order to prevent the current readtable from influencing the content
being written to the FASL: the READTABLE-CASE setting influences symbol printing.")
(declaim (ftype (function (t stream) t) dump-form)) (declaim (ftype (function (t stream) t) dump-form))
(defun dump-form (form stream) (defun dump-form (form stream)
(let ((*print-fasl* t) (let ((*print-fasl* t)
...@@ -142,6 +148,7 @@ ...@@ -142,6 +148,7 @@
(*print-readably* t) (*print-readably* t)
(*print-right-margin* nil) (*print-right-margin* nil)
(*print-structure* t) (*print-structure* t)
(*readtable* *the-fasl-printer-readtable*)
;; make sure to write all floats with their exponent marker: ;; make sure to write all floats with their exponent marker:
;; the dump-time default may not be the same at load-time ;; the dump-time default may not be the same at load-time
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment