emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/parseedn b399b72a8e 1/6: Iterative parseedn-print-seq


From: ELPA Syncer
Subject: [nongnu] elpa/parseedn b399b72a8e 1/6: Iterative parseedn-print-seq
Date: Fri, 20 May 2022 04:59:02 -0400 (EDT)

branch: elpa/parseedn
commit b399b72a8ea0d7698aaaff80c8a43eda943c49fb
Author: tmpUser2022 <98637343+tmpUser2022@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Iterative parseedn-print-seq
    
    Avoid C stack overflows, `(error "Variable binding depth exceeds 
max-specpdl-size")` and `(error "Lisp nesting exceeds ‘max-lisp-eval-depth’")` 
when working with large sequences.
---
 parseedn.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/parseedn.el b/parseedn.el
index 1e06e54218..5422b25f06 100644
--- a/parseedn.el
+++ b/parseedn.el
@@ -156,12 +156,12 @@ TAG-READERS is an optional association list.  For more 
information, see
 
 (defun parseedn-print-seq (coll)
   "Insert sequence COLL as EDN into the current buffer."
-  (unless (seq-empty-p coll)
-    (parseedn-print (elt coll 0)))
-  (let ((next (seq-drop coll 1)))
-    (when (not (seq-empty-p next))
+  (when (not (seq-empty-p coll))
+    (while (not (seq-empty-p coll))
+      (parseedn-print (elt coll 0))
       (insert " ")
-      (parseedn-print-seq next))))
+      (setq coll (seq-drop coll 1)))
+    (delete-char -1)))
 
 (defun parseedn-print-hash-or-alist (map &optional ks)
   "Insert hash table MAP or elisp alist as an EDN map into the current buffer."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]