[Top][All Lists]
[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 13:13:45 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
* Stefan Monnier [2008-09-13 04:22+0200] writes:
> Of course, you may still want to have an ad-hoc output that hides the
> internal representation, even if the internal representation can be
> printed in an acceptable amount of time.
>
> Maybe we should introduce a notion of "object" (in the OO sense) in
> Emacs's internal representation, so EIEIO (and CL's defstruct) could
> then provide its own printer code.
>
> The simplest way to do that might be to simply introduce a new array
> type called `object', which would work just like array, except that when
> it's printed, it's passed through
> (run-hook-with-args-until-success 'object-print-functions obj), so EIEIO
> and CL could hook into object-print-functions. Or we could even stuff
> a "class ID" small integer inside the array's size info, so we could
> lookup an object-printer-table.
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.
Helmut.