From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: "simplifications" Date: Mon, 19 Nov 2007 16:19:10 +0100 Message-ID: <86pry6xnyp.fsf@lola.quinscape.zz> 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 1195485588 11260 80.91.229.12 (19 Nov 2007 15:19:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Nov 2007 15:19:48 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 19 16:19:54 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 1Iu8Pb-000155-7K for ged-emacs-devel@m.gmane.org; Mon, 19 Nov 2007 16:19:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iu8PN-0003lO-9u for ged-emacs-devel@m.gmane.org; Mon, 19 Nov 2007 10:19:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iu8PC-0003c3-76 for emacs-devel@gnu.org; Mon, 19 Nov 2007 10:19:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Iu8P5-0003Uw-9e for emacs-devel@gnu.org; Mon, 19 Nov 2007 10:19:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iu8P4-0003UP-4E for emacs-devel@gnu.org; Mon, 19 Nov 2007 10:19:14 -0500 Original-Received: from pc3.berlin.powerweb.de ([62.67.228.11]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Iu8P3-00063J-If for emacs-devel@gnu.org; Mon, 19 Nov 2007 10:19:13 -0500 Original-Received: from quinscape.de (mail.quinscape.de [212.29.44.217]) by pc3.berlin.powerweb.de (8.9.3p3/8.9.3) with ESMTP id QAA16557 for ; Mon, 19 Nov 2007 16:19:05 +0100 X-Delivered-To: Original-Received: (qmail-ldap/ctrl 20952 invoked from network); 19 Nov 2007 15:19:11 -0000 Original-Received: from unknown (HELO lola.quinscape.zz) ([10.0.3.43]) (envelope-sender ) by ns.quinscape.de (qmail-ldap-1.03) with SMTP for ; 19 Nov 2007 15:19:10 -0000 Original-Received: by lola.quinscape.zz (Postfix, from userid 1001) id E8DB38F231; Mon, 19 Nov 2007 16:19:10 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Mon\, 19 Nov 2007 10\:11\:41 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-AntiVirus: checked by AntiVir MailGate (version: 2.1.3-2; AVE: 7.6.0.34; VDF: 7.0.0.232; host: quinx) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:83655 Archived-At: Stefan Monnier writes: >> 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" defsubst is an advanced construct. I think it is reasonable to give fewer guarantees about its operation than we do for defun. -- David Kastrup