From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Elisp printer Date: Tue, 07 Mar 2017 23:35:45 -0700 Message-ID: <87varkz35q.fsf@tromey.com> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1488954975 22827 195.159.176.226 (8 Mar 2017 06:36:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2017 06:36:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 08 07:36:08 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 1clVCg-0004fX-Ta for ged-emacs-devel@m.gmane.org; Wed, 08 Mar 2017 07:36:07 +0100 Original-Received: from localhost ([::1]:54392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clVCl-0001yE-BU for ged-emacs-devel@m.gmane.org; Wed, 08 Mar 2017 01:36:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clVCf-0001y6-Oo for emacs-devel@gnu.org; Wed, 08 Mar 2017 01:36:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clVCc-0002pg-JB for emacs-devel@gnu.org; Wed, 08 Mar 2017 01:36:05 -0500 Original-Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:38807) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1clVCc-0002o4-5T for emacs-devel@gnu.org; Wed, 08 Mar 2017 01:36:02 -0500 Original-Received: (qmail 8457 invoked by uid 0); 8 Mar 2017 06:35:57 -0000 Original-Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy7.mail.unifiedlayer.com with SMTP; 8 Mar 2017 06:35:57 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id tJbq1u00A2f2jeq01JbtZ2; Tue, 07 Mar 2017 23:35:56 -0700 X-Authority-Analysis: v=2.1 cv=H5NInYoi c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=6Iz7jQTuP9IA:10 a=m989ZCZI9TT5NeBGvqQA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2YSr9dk7TAZriPIxan4nIalE0vUa3zzgPAWMLH6R7F8=; b=euTKEx9OkPqrWKKXsaXh6c5S7/ Fat8G7V87jO++8IvBGnuu+nPuyFlR91FDKG7Zr8uq94rjP3jgJKLILChdRBWcqcMt8svzx6rrNhBw KyBqFJKwHbr/AWvCOGLAn2jAf; Original-Received: from 67-6-181-22.hlrn.qwest.net ([67.6.181.22]:59168 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1clVCQ-0004MU-3v; Tue, 07 Mar 2017 23:35:50 -0700 X-Attribution: Tom In-Reply-To: (Stefan Monnier's message of "Tue, 07 Mar 2017 23:39:55 -0500") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 67.6.181.22 X-Exim-ID: 1clVCQ-0004MU-3v X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 67-6-181-22.hlrn.qwest.net (bapiya) [67.6.181.22]:59168 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 70.40.196.235 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:212832 Archived-At: >>>>> "Stefan" == Stefan Monnier writes: >> I was wondering about this a while ago and thinking that maybe it could >> be done without C changes by repurposing the extra arguments to >> make-byte-code. The idea here would be to let cl-defsubst take a new >> :type argument other than 'vector or 'list, meaning "use >> make-byte-code"; and set the :initial-offset to skip over the stuff >> necessary for the bytecode. Stefan> Yes, that can be done fairly easily. But that doesn't give you Stefan> callable functions: it just gives you structs represented by Stefan> those special "compiled-function" vectors. 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. I'm not 100% sure this addresses what you're looking for; if not I'd appreciate it if you could explain more. 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. I'm not sure that this omission is so bad, but maybe make-thunk could wrap the body of the generated function in some cl-symbol-macrolet forms Tom