From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: "simplifications" Date: Mon, 19 Nov 2007 10:11:41 -0500 Message-ID: References: <86ejem1pig.fsf@lola.quinscape.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195485137 9524 80.91.229.12 (19 Nov 2007 15:12:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Nov 2007 15:12:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 19 16:12:13 2007 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 1Iu8IE-0006kH-2y for ged-emacs-devel@m.gmane.org; Mon, 19 Nov 2007 16:12:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iu8Hz-0008Tv-Qn for ged-emacs-devel@m.gmane.org; Mon, 19 Nov 2007 10:11:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iu8Hv-0008SJ-MP for emacs-devel@gnu.org; Mon, 19 Nov 2007 10:11:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iu8Hu-0008RD-S5 for emacs-devel@gnu.org; Mon, 19 Nov 2007 10:11:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iu8Hu-0008R5-2N for emacs-devel@gnu.org; Mon, 19 Nov 2007 10:11:50 -0500 Original-Received: from bc.sympatico.ca ([209.226.175.184] helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iu8Hm-00041Y-6h; Mon, 19 Nov 2007 10:11:42 -0500 Original-Received: from ceviche.home ([70.55.147.211]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20071119151141.QOXR18413.tomts22-srv.bellnexxia.net@ceviche.home>; Mon, 19 Nov 2007 10:11:41 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0B17BB42DA; Mon, 19 Nov 2007 10:11:40 -0500 (EST) In-Reply-To: (Juanma Barranquero's message of "Mon, 19 Nov 2007 11:56:35 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) 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:83654 Archived-At: > is not my idea of fun, or legible, or maintainable, or... you pick the > word. Not that c??r is much of an improvement; we should be able to > define accesor functions in the package > (defsubst ring--vec (ring) > (cdr (cdr ring))) > and have the byte-compiler optimize them away. 1 - if you use defsubst* the byte-code will look good. 2 - you can use defstruct to get all that and more. 3 - I don't think it's worth the trouble to make the byte-optimizer more complex for such little benefit. If you want to improve it, use the lexbind branch: it's a much saner starting point. Stefan "whose local Emacs hacks include some byte-optimizer improvement which does manage to optimize `cadr' but it's too much work works with too many limitations and on top of that, it's not even clear that the optimization is always correct: it doesn't account for the case where you do (defsubst cadr (debug-on-error) (car (cdr debug-on-error))) in which case the optimization is not semantics preserving"