From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: Enhancement suggestion: prin1 extension mechanism Date: Sat, 13 Sep 2008 13:13:45 +0200 Message-ID: References: <200809110325.m8B3PYFE031034@projectile.siege-engine.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221304535 18348 80.91.229.12 (13 Sep 2008 11:15:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Sep 2008 11:15:35 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 13 13:16:31 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KeT76-00078R-SQ for ged-emacs-devel@m.gmane.org; Sat, 13 Sep 2008 13:16:29 +0200 Original-Received: from localhost ([127.0.0.1]:38855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeT66-0006X1-0G for ged-emacs-devel@m.gmane.org; Sat, 13 Sep 2008 07:15:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeT5s-0006VH-12 for emacs-devel@gnu.org; Sat, 13 Sep 2008 07:15:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeT5o-0006Ti-R5 for emacs-devel@gnu.org; Sat, 13 Sep 2008 07:15:10 -0400 Original-Received: from [199.232.76.173] (port=34876 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeT5o-0006TW-0V for emacs-devel@gnu.org; Sat, 13 Sep 2008 07:15:08 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:33355 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KeT5n-000302-Gg for emacs-devel@gnu.org; Sat, 13 Sep 2008 07:15:07 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1KeT5i-0003tn-8b for emacs-devel@gnu.org; Sat, 13 Sep 2008 11:15:02 +0000 Original-Received: from dialin-226071.rol.raiffeisen.net ([195.254.226.71]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Sep 2008 11:15:02 +0000 Original-Received: from eller.helmut by dialin-226071.rol.raiffeisen.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Sep 2008 11:15:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dialin-226071.rol.raiffeisen.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:vAyvb1aAyX8BPRzdfYRatppWBck= X-detected-kernel: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103869 Archived-At: * 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.