From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase] Date: Fri, 24 Feb 2017 11:06:53 +0900 (JST) 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1257686666-1487902017=:8153" X-Trace: blaine.gmane.org 1487902033 8482 195.159.176.226 (24 Feb 2017 02:07:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 24 Feb 2017 02:07:13 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: cpitclaudel@gmail.com, Tino Calancha , vibhavp@gmail.com, Emacs developers , monnier@iro.umontreal.ca, eliz@gnu.org, Drew Adams To: "T.V Raman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 24 03:07:09 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 1ch5Hm-0001Y8-0P for ged-emacs-devel@m.gmane.org; Fri, 24 Feb 2017 03:07:06 +0100 Original-Received: from localhost ([::1]:34126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ch5Hr-0007NE-Tq for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2017 21:07:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ch5Hj-0007He-Kk for emacs-devel@gnu.org; Thu, 23 Feb 2017 21:07:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ch5Hi-0006IA-Ko for emacs-devel@gnu.org; Thu, 23 Feb 2017 21:07:03 -0500 Original-Received: from mail-pg0-x22e.google.com ([2607:f8b0:400e:c05::22e]:34070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ch5He-0006Gs-Px; Thu, 23 Feb 2017 21:06:58 -0500 Original-Received: by mail-pg0-x22e.google.com with SMTP id 1so4287549pgi.1; Thu, 23 Feb 2017 18:06:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=+HoSZqDLOEvvYZSv0InkFT6RoaxYOrcxYBOY2WmOAwg=; b=u+N3U7uIdYRzH2QYw9MZDVaO6qujh/sieYXpFVZ5681RL0mxT6joZVd9PUSy2/0b9Y UzKF8U0Ay99FV1H+xaab1T5vsfjz2I2ENxK/NU7gUU21i5KYT08qEx9lwveYOZ+wdWTG T593KfgT3bU2SCk/676mLRZ8mdFzZ2ixiuQ95A+F/PH9YgNCDTS2VielFD937CvduOy+ 2wkT+WYa4O3KApVu1tQvwacBwwtUe3OjdAbdzIaeMHKN2s2+CWzsn5Ydx28TnBIHk8sU /x9irlHSHPlttf2UWcu4AvjDyCPsL00JT3+EhPAlJdNhCmxXlxayPQmo3MT53/Hkg8oO F7Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=+HoSZqDLOEvvYZSv0InkFT6RoaxYOrcxYBOY2WmOAwg=; b=nmo5LZKhPtWqqbGV073RnKdg3E5ySLfqHMKXLsC9zFmjjiL/C49CLCV+GozA7nw4gX +ULpjaz5WlKQeGUdshz8q6yFTOyC/Hy2UJxFtAneQyUhmJAZ3O7Ie6ETd7DU78DVtg5i +mMCvwBWOsloUWiOrudw33w266MiarTHKaRB/dtE2JCqCpxKhlQNRyxb9dQj2re8gtbI FFglC8v0hFhAL2LEUcpUrFs9iVKo3IEXgMuRwXvhxEv0bj+3/+p81+7NmolAmNATIfUH B+dwSv1iDzWkQXdrLoPB7pF/BXOiLfeETeOP6XzUOYkZNxThvO7uwg3uFjlaDuc246nu cDXQ== X-Gm-Message-State: AMke39kxvNoYeMG2g2LW3C2Hl+8nb/l05KZprzHxBi3iLg9ntZkQJqHRnaWNJy0VLe2FaA== X-Received: by 10.99.181.7 with SMTP id y7mr361634pge.57.1487902017932; Thu, 23 Feb 2017 18:06:57 -0800 (PST) Original-Received: from calancha-pc (104.81.147.124.dy.bbexcite.jp. [124.147.81.104]) by smtp.gmail.com with ESMTPSA id n123sm12013434pga.9.2017.02.23.18.06.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Feb 2017 18:06:57 -0800 (PST) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <22703.10479.123157.339839@retriever.mtv.corp.google.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::22e 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:212557 Archived-At: --8323329-1257686666-1487902017=:8153 Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 23 Feb 2017, T.V Raman wrote: > Please separate your personal opinion from fact. And asserting that > using defsubst is "misguided " is not a useful way of carrying on a > conversation. > > Drew Adams writes: > > > Really? What should we be using, and when was defsubst deprecated? > > > defun or defmacro > > It has not been deprecated. > > I was expressing my opinion: It's rarely, if ever, needed, > > and misguided uses of it instead of defun are bothersome. Hi Raman, I guess Drew meant that defsubst makes debugging harder. It also complicates advising. I know he does extensively use of advising in his own libraries. The manual mention some disadvantages on using defsubst in `(elisp) inline functions': "Also, inline functions do not behave well with respect to debugging, tracing, and advising (*note Advising Functions::). Since ease of debugging and the flexibility of redefining functions are important features of Emacs, you should not make a function inline, even if it˘s small, unless its speed is really crucial, and you˘ve timed the code to verify that using ˇdefun˘ actually has performance problems." I find worth to read the whole node. I used to be confused about when to use (to not) defsubst. --8323329-1257686666-1487902017=:8153--