Commit 6af67b4a authored by Stefan Monnier's avatar Stefan Monnier Committed by Ken Raeburn

Reduce lread substitutions.

* src/lread.c (read1): After reading an object using the "#n=" syntax,
if the read object is a cons cell, instead of recursively substituting
the placeholder with the new object, mutate the placeholder cons cell
itself to have the correct car and cdr values.
parent 0b3a0f30
......@@ -2990,6 +2990,14 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
tem = read0 (readcharfun);
/* Now put it everywhere the placeholder was... */
if (CONSP (tem))
Fsetcar (placeholder, XCAR (tem));
Fsetcdr (placeholder, XCDR (tem));
return placeholder;
Fsubstitute_object_in_subtree (tem, placeholder);
/* ...and #n# will use the real value from now on. */
......@@ -2997,6 +3005,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
return tem;
/* #n# returns a previously read object. */
if (c == '#')
Markdown is supported
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