emacs-devel
[Top][All Lists]
Advanced

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

Re: A question about read syntax and compiled backreferences


From: Miles Bader
Subject: Re: A question about read syntax and compiled backreferences
Date: Tue, 23 Jan 2007 18:48:31 +0900

"Juanma Barranquero" <address@hidden> writes:
> (defun test ()
>  (let ((z '#1=(a b . #1#)))
>    (safe-length z)))
>
> but trying to loading it from a byte-compiled file brings
>
>  Invalid read syntax: "#"

The following patch seems to fix this bug; I'm not sure if it's OK to
apply or not (is print-circle significantly slower?).

-Miles


2007-01-23  Miles Bader  <address@hidden>

        * emacs-lisp/bytecomp.el (byte-compile-output-file-form)
        (byte-compile-output-docform): Bind `print-circle' to t.

--- orig/lisp/emacs-lisp/bytecomp.el
+++ mod/lisp/emacs-lisp/bytecomp.el
@@ -1,7 +1,7 @@
 ;;; bytecomp.el --- compilation of Lisp code into byte code
 
 ;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;;   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Jamie Zawinski <address@hidden>
 ;;     Hallvard Furuseth <address@hidden>
@@ -2082,7 +2082,8 @@
          (print-length nil)
          (print-level nil)
          (print-quoted t)
-         (print-gensym t))
+         (print-gensym t)
+         (print-circle t))            ; handle circular data structures
       (princ "\n" outbuffer)
       (prin1 form outbuffer)
       nil)))
@@ -2139,6 +2140,7 @@
               ;; print-gensym-alist not to be cleared
               ;; between calls to print functions.
               (print-gensym '(t))
+              (print-circle t)        ; handle circular data structures
               print-gensym-alist    ; was used before print-circle existed.
               (print-continuous-numbering t)
               print-number-table


-- 
"Whatever you do will be insignificant, but it is very important that
 you do it."  Mahatma Gandhi




reply via email to

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