From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Elisp printer Date: Wed, 08 Mar 2017 04:43:44 -0500 Message-ID: References: <87pokampa4.fsf@ericabrahamsen.net> <8760m2mmlq.fsf@ericabrahamsen.net> <87lguq5r87.fsf@ericabrahamsen.net> <878tp0i74g.fsf@users.sourceforge.net> <87efyg6y0i.fsf_-_@drachen> <87zigwz9wx.fsf@tromey.com> <87varkz35q.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488966254 20345 195.159.176.226 (8 Mar 2017 09:44:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 09:44:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 08 10:44:10 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clY8b-0004RG-DM for ged-emacs-devel@m.gmane.org; Wed, 08 Mar 2017 10:44:05 +0100 Original-Received: from localhost ([::1]:55134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clY8h-0003Ld-Ic for ged-emacs-devel@m.gmane.org; Wed, 08 Mar 2017 04:44:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clY8b-0003LN-9Y for emacs-devel@gnu.org; Wed, 08 Mar 2017 04:44:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clY8Y-00016z-6b for emacs-devel@gnu.org; Wed, 08 Mar 2017 04:44:05 -0500 Original-Received: from [195.159.176.226] (port=54811 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1clY8X-00016h-W3 for emacs-devel@gnu.org; Wed, 08 Mar 2017 04:44:02 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1clY8M-00030d-7x for emacs-devel@gnu.org; Wed, 08 Mar 2017 10:43:50 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:u0rdBUlnyoV/YaBUrBXOpIJ8YHE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212838 Archived-At: > What I forgot to mention is that this would be coupled with a slot in > the base class that holds the function to "actually call", and the > underlying call to make-byte-code would install some bytecode that would > simply funcall whatever is in this slot, maybe passing in the object as > a first argument. But that adds a funcall-indirection. Given the cost of funcalls in Elisp, this is a fairly major price to pay. In that case, you're better off representing your functions as symbols, so you store the actual function in the function slot, and the data slots in the symbol-plist or symbol-value slots. > I'm not 100% sure this addresses what you're looking for; if not I'd > appreciate it if you could explain more. Yes, it would, except I don't like its performance. > One thing I note is that this doesn't provide the "sugar" of being able > to refer to slots using their bare name, you'd have to use accessors. That sugar is just an attractive idea, not indispensable. Stefan