unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: "Juanma Barranquero" <lekktu@gmail.com>
Cc: Andreas Schwab <schwab@suse.de>,
	Emacs Devel <emacs-devel@gnu.org>, Miles Bader <miles@gnu.org>
Subject: Re: A question about read syntax and compiled backreferences
Date: Sun, 28 Jan 2007 10:35:15 +0100	[thread overview]
Message-ID: <85tzybsdd8.fsf@lola.goethe.zz> (raw)
In-Reply-To: <f7ccd24b0701271535r7fe15955o4ec5db98facd98dc@mail.gmail.com> (Juanma Barranquero's message of "Sun\, 28 Jan 2007 00\:35\:41 +0100")

"Juanma Barranquero" <lekktu@gmail.com> writes:

> On 1/27/07, David Kastrup <dak@gnu.org> 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


    Documentation:
    *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	other threads:[~2007-01-28  9:35 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-22 16:13 A question about read syntax and compiled backreferences Juanma Barranquero
2007-01-22 21:38 ` Eli Zaretskii
2007-01-23  8:54   ` Juanma Barranquero
2007-01-23  9:48 ` Miles Bader
2007-01-23 12:50   ` Juanma Barranquero
2007-01-24  0:31     ` Miles Bader
2007-01-24  0:50       ` Juanma Barranquero
2007-01-24  8:22   ` Richard Stallman
2007-01-24 13:58     ` Miles Bader
2007-01-27 17:10   ` Andreas Schwab
2007-01-27 17:28     ` Andreas Schwab
2007-01-27 17:36       ` Juanma Barranquero
2007-01-27 21:55         ` David Kastrup
2007-01-27 22:17           ` Romain Francoise
2007-01-27 23:35           ` Juanma Barranquero
2007-01-28  9:35             ` David Kastrup [this message]
2007-01-28  9:51               ` Andreas Schwab
2007-01-28 11:08                 ` David Kastrup
2007-01-29 20:29                   ` Stuart D. Herring
2007-01-29  5:37               ` Richard Stallman
2007-01-28 19:48             ` Richard Stallman
2007-01-27 22:22         ` Stefan Monnier
2007-01-27 23:15           ` Andreas Schwab
2007-01-28  0:31             ` Kim F. Storm
2007-01-28 19:48               ` Richard Stallman
2007-01-28  0:10           ` Miles Bader
2007-01-28  7:41         ` Richard Stallman
2007-01-29  1:31           ` Kenichi Handa
2007-01-29  4:51             ` Miles Bader
2007-01-29 23:52               ` Richard Stallman
2007-02-11 12:13                 ` Romain Francoise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85tzybsdd8.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=miles@gnu.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).