[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/raeburn-startup 3b47eb4 02/17: Reduce lread substi
From: |
Ken Raeburn |
Subject: |
[Emacs-diffs] scratch/raeburn-startup 3b47eb4 02/17: Reduce lread substitutions. |
Date: |
Thu, 15 Dec 2016 11:33:17 +0000 (UTC) |
branch: scratch/raeburn-startup
commit 3b47eb4dba691e3b98c8af348682472b85d6c62d
Author: Stefan Monnier <address@hidden>
Commit: Ken Raeburn <address@hidden>
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.
---
src/lread.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/lread.c b/src/lread.c
index ada5cbf..2d87c4c 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2940,12 +2940,21 @@ read1 (Lisp_Object readcharfun, int *pch, bool
first_in_list)
tem = read0 (readcharfun);
/* Now put it everywhere the placeholder was... */
- substitute_object_in_subtree (tem, placeholder);
+ if (CONSP (tem))
+ {
+ Fsetcar (placeholder, XCAR (tem));
+ Fsetcdr (placeholder, XCDR (tem));
+ return placeholder;
+ }
+ else
+ {
+ substitute_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. */
- [Emacs-diffs] branch scratch/raeburn-startup created (now 6a7d996), Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 04b9ff6 03/17: Short-circuit substitutions for some simple types., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 3b47eb4 02/17: Reduce lread substitutions.,
Ken Raeburn <=
- [Emacs-diffs] scratch/raeburn-startup 3dd6aa7 13/17: Create *Messages* buffer when loading dumped data., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup f48e12c 06/17: Reduce nested calls during substitution., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 702bcad 15/17: Don't memset storage we're about to fill anyway., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup c95f727 16/17: Dump defvars for special variables only., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 8e7ec27 07/17: Use a hash table for seen_list, similar to read_objects_map., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup dcc4b55 04/17: Replace read_objects assoc list with two hash tables., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 8f37b82 08/17: Stefan's patch to write out and load "dumped.elc"; Oct 31 version., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 872c9f6 05/17: Don't generate excessive hash tables during reads., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 44f3368 11/17: Force purification off when using dumped.elc., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 2fa607a 10/17: Increase the obarray size., Ken Raeburn, 2016/12/15