emacs-devel
[Top][All Lists]
Advanced

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

Re: Enhancement suggestion: prin1 extension mechanism


From: Helmut Eller
Subject: Re: Enhancement suggestion: prin1 extension mechanism
Date: Sat, 13 Sep 2008 23:13:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

* 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 via email to

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