how to stop the annotation of lists by filenames?



On 5/31/08, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> You don't need to modify mload.lisp, just redefine the add-lineinfo function:

Well, a different approach is to suppress the lineinfo in output
(if I understand correctly, it was the bloating of save output that
was the immediate problem). Here is a patch for that.

diff -u -r1.21 dskfn.lisp
--- dskfn.lisp  29 Mar 2008 21:29:20 -0000      1.21
+++ dskfn.lisp  31 May 2008 20:14:16 -0000
@@ -329,10 +329,19 @@
   (fasprint nil form))

 (defun fasprint (eqfl form)
-  (cond ((null fasdumpfl) (print form savefile))
+  (cond ((null fasdumpfl) (print (strip-lineinfo (copy-tree form)) savefile))
        (eqfl (setq fasdeqlist (cons form fasdeqlist)))
        (t (setq fasdnoneqlist (cons form fasdnoneqlist)))))

+(defun strip-lineinfo (x)
+  (when (consp x)
+    (strip-lineinfo-0 (car x))
+    (mapc #'strip-lineinfo (cdr x))))
+
+(defun strip-lineinfo-0 (x)
+  (when (consp x)
+   (delete-if #'(lambda (y) (and (consp y) (member 'src y))) x)))
+
 (defun unstorep (item)
   (i-$unstore (ncons item)))


The intent is destructive modification of the argument of STRIP-LINEINFO-0.
I can't tell if DELETE-IF guarantees destructive modification;
maybe someone knows for sure. I wouldn't be surprised if there were
an entirely different, better way.

FWIW

Robert Dodier