[Top][All Lists]

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

Re: A question about read syntax and compiled backreferences

From: David Kastrup
Subject: Re: A question about read syntax and compiled backreferences
Date: Sun, 28 Jan 2007 10:35:15 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

"Juanma Barranquero" <address@hidden> writes:

> On 1/27/07, David Kastrup <address@hidden> wrote:
>> I don't think that
>> the ability to byte-compile code with circular lists is really
>> important enough to warrant this sort of inconvenience.
> I don't think having a local variable to deactivate it is
> inconvenient; after all, there's only a few elisp packages in Emacs
> where the slowdown is significant.
> OTOH, perhaps we could to the reverse: default print-circle to nil
> during byte-compilation, and add a variable to activate it for the few
> files that really need it.

Sounds more sensible to me.  But actually, I see

    print-circle is a variable defined in `src/print.c'.
    Its value is nil

    *Non-nil means print recursive structures using #N= and #N# syntax.
    If nil, printing proceeds recursively and may lead to
    `max-lisp-eval-depth' being exceeded or an error may occur:
    "Apparently circular structure being printed."  Also see
    `print-length' and `print-level'.
    If non-nil, shared substructures anywhere in the structure are printed
    with `#N=' before the first occurrence (in the order of the print
    representation) and `#N#' in place of each subsequent occurrence,
    where N is a positive decimal integer.

Can't we just catch the error, remove what has been printed so far,
and retry with print-circle set?

That would give us no performance hit whatsoever during normal
operation and would allow circular structures without announcing them.
And the performance hit occurs not on the whole file, but just on the
structure in question.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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