[slime-devel] Avoid low apply limit

Eduardo Muñoz emufer at terra.es
Wed Dec 22 22:01:37 UTC 2004




LispWorks has a low args limit for apply. The following
patch (inlined below) avoids landing on sldb when inspecting
long lists. I think that its safe to #'nconc (nreverse
... but there isnt a noticeable change of speed or consing
so it may be more conservative to just use reduce.


Index: swank.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank.lisp,v
retrieving revision 1.272
diff -u -r1.272 swank.lisp
--- swank.lisp	16 Dec 2004 21:16:50 -0000	1.272
+++ swank.lisp	22 Dec 2004 21:56:41 -0000
@@ -2631,7 +2631,7 @@
                            (let ((a (if (null l)
                                         a
                                         (cons (label-value-line :tail l) a))))
-                             (apply #'append (reverse a)))))))
+                             (reduce #'nconc (nreverse a)))))))
                  (values title (append '("Elements:" (:newline)) lines)))))
                                
         (cond ((not length)             ; circular


-- 
Eduardo Muñoz          | (prog () 10 (print "Hello world!")
http://213.97.131.125/ |          20 (go 10))




More information about the slime-devel mailing list