unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Enhancement suggestion: prin1 extension mechanism
Date: Sat, 13 Sep 2008 23:13:03 +0200	[thread overview]
Message-ID: <m23ak3697k.fsf@gmail.com> (raw)
In-Reply-To: jwv4p4jhmwb.fsf-monnier+emacs@gnu.org

* Stefan Monnier [2008-09-13 21:22+0200] writes:

>> Instead of changing the internal representation, you could allow entries
>> for vector and cons etc. in the printer table.  That's how Common Lisp
>> allows you to customize the printer for built-in types.
>
> I fear it'd be difficult to make it work without incurring a significant
> performance overhead.

If the table is nil you could use the default hardcoded printer without
lookups. 

If the entries in the table can be accessed from Lisp code, we could
remember the default print function for a type before installing a
custom printer.  E.g. if a vector doesn't have the special symbol in the
first entry, we could call the previously remembered default printer
instead of iterating manually over the vector.  Recursive calls to print
would again use the custom print function.

It seems to me that, compared to testing for circularity, those table
lookups would only introduce a minor slowdown.  And if someone produces
so much output the that it takes to long to print, he probably doesn't
want to read it anyway :-)

Helmut.





  reply	other threads:[~2008-09-13 21:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-11  3:25 Enhancement suggestion: prin1 extension mechanism Eric M. Ludlam
2008-09-13  0:30 ` Richard M. Stallman
2008-09-14 15:47   ` Re[2]: " Eric M. Ludlam
2008-09-15 13:23     ` Richard M. Stallman
2008-09-15 16:31       ` Ted Zlatanov
2008-09-13  2:22 ` Stefan Monnier
2008-09-13 11:13   ` Helmut Eller
2008-09-13 19:22     ` Stefan Monnier
2008-09-13 21:13       ` Helmut Eller [this message]
2008-09-14 19:35         ` Stefan Monnier
2008-09-14 22:09           ` Helmut Eller

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=m23ak3697k.fsf@gmail.com \
    --to=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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).