From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: raman Newsgroups: gmane.emacs.devel Subject: Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase] Date: Thu, 23 Feb 2017 19:56:19 -0800 Message-ID: References: <1b07c68a-873e-83c8-246d-423bc83a3881@gmail.com> <83y3xg4ldw.fsf@gnu.org> <22703.8413.359650.67917@retriever.mtv.corp.google.com> <22703.10479.123157.339839@retriever.mtv.corp.google.com> <87mvdcfffg.fsf@pellet> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1487908593 7106 195.159.176.226 (24 Feb 2017 03:56:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 24 Feb 2017 03:56:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 24 04:56:29 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 1ch6zc-0001Mz-UN for ged-emacs-devel@m.gmane.org; Fri, 24 Feb 2017 04:56:29 +0100 Original-Received: from localhost ([::1]:34500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ch6zi-000193-U7 for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2017 22:56:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ch6zZ-00018m-JB for emacs-devel@gnu.org; Thu, 23 Feb 2017 22:56:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ch6zW-0007Do-HC for emacs-devel@gnu.org; Thu, 23 Feb 2017 22:56:25 -0500 Original-Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:35880) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ch6zW-0007Dj-Ar for emacs-devel@gnu.org; Thu, 23 Feb 2017 22:56:22 -0500 Original-Received: by mail-pf0-x22f.google.com with SMTP id c193so1036167pfb.3 for ; Thu, 23 Feb 2017 19:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=AMnda1ogw7wkUvsLswRFKEar0CDd8FrLRriV2PIQEfw=; b=AZdaPW4XlHjm7CEeueL5YoOmleBREbvpdP2lk+bdTPqLi0PQpI0mpiipejX0VdssY1 I1PL3QEwTJx4p167ffHb56qitfToN4uO5bSappSqzQHA7h7UlhMiqJdPOVbUoqKc1Wz9 TxUz6sHfwhpaUSDDowRlZGJ9FKmjLT0fcBrOqBdVdTGK++4VfSpzyp5cOw+DU51PKmgd Ofq8XWeJ5ao6lDdTmowChmEZdtXAQ+sc0naQiqOmDIeqq6ib6UESRTs6uaIrSd2ffaq7 VbfeXf4RQnUG32sui1RAWJ28QGDTr17HIOeHWNEQX2BLd0hh3Rh+0W6Wfp+Qp0nW9Msb HnXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AMnda1ogw7wkUvsLswRFKEar0CDd8FrLRriV2PIQEfw=; b=lZsZAGQqQuczb/sFiaq9O1D17JVcpyFMBHzNcmb4Ma2XfqKwsQKM4xKTPoS+UdtCbT n+MPOibcSQL49L9GQ0tO+hivjQtkfjxm3sYIRMhqZM55lCXPib2JsBQ4Ayv2zlYJd9Gd JDWE8J/K4G4ELF/4JpguyhoYwhlcG/FxIaajCv7L0r9PtijT+ppwsi8JwfSvIqG4z0LB USo41WmZuvvdBeVY+Y4gwvlgr+iuCZ0ZLCbTJ+D6kYVBoXicHlAqC3YQjoo617gphZ6t H5bb07BALgHnxdMtn3dwliIAWtddZuxP2Hx9Cxx10lYBJwpNvUVMkPJ3bf34f5v0XAeT Ar6Q== X-Gm-Message-State: AMke39n5t5VKsNRfFNcNi/jUubwGveeXgVu0kcMxuvmyGZqPDsYKfKB7Qm+j6QoGx0TQ4hA4 X-Received: by 10.98.43.4 with SMTP id r4mr879891pfr.96.1487908581167; Thu, 23 Feb 2017 19:56:21 -0800 (PST) Original-Received: from raman-glaptop2 (c-73-170-121-60.hsd1.ca.comcast.net. [73.170.121.60]) by smtp.gmail.com with ESMTPSA id z127sm12306417pgz.29.2017.02.23.19.56.20 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 23 Feb 2017 19:56:20 -0800 (PST) In-Reply-To: <87mvdcfffg.fsf@pellet> (Eric Abrahamsen's message of "Thu, 23 Feb 2017 19:14:43 -0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::22f 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:212561 Archived-At: The rule of thumb I've used over the years: 1. Never use defmacro except when creating a special-form or special notation AKA DSL 2. Use defun except for short and often repeated forms that also need speed, then I've used defsubst because they behave like functions for all practical purposes such as mapcar. 3. I had done some timing in the early days of emacspeak, including looking at what M-x disassemble produced, then tighten the inner loop of emacspeak appropriately with defsubst. 4. What just broke is calls to defsubst-defined functions from within other defsubst --- independent of our various views on the misguidedness or otherwise of defsubst, I believe this is a bug that might be worth fixing since it breaks working code in mysterious and unpredictable ways. --