* 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.
tem = read0 (readcharfun);
/* Now put it everywhere the placeholder was... */
- Fsubstitute_object_in_subtree (tem, placeholder);
+ if (CONSP (tem))
+ {
+ Fsetcar (placeholder, XCAR (tem));
+ Fsetcdr (placeholder, XCDR (tem));
+ return placeholder;
+ }
+ else
+ {
+ Fsubstitute_object_in_subtree (tem, placeholder);
- /* ...and #n# will use the real value from now on. */
- Fsetcdr (cell, tem);
+ /* ...and #n# will use the real value from now on. */
+ Fsetcdr (cell, tem);
- return tem;
+ return tem;
+ }
}
/* #n# returns a previously read object. */