From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: zerop: compiler macro vs defsubst (was: no empty (zero) string predicate in Elisp) Date: Mon, 27 Apr 2015 12:28:14 +0200 Message-ID: <87h9s17tmp.fsf_-_@yahoo.fr> References: <87h9s4rhx5.fsf@debian.uxu> <874mo4jmb7.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1430130684 9163 80.91.229.3 (27 Apr 2015 10:31:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Apr 2015 10:31:24 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 27 12:31:11 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YmgJg-0007cD-9r for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Apr 2015 12:31:08 +0200 Original-Received: from localhost ([::1]:54003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmgJf-0005Xn-LK for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Apr 2015 06:31:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmgJV-0005Xi-Fj for help-gnu-emacs@gnu.org; Mon, 27 Apr 2015 06:30:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmgJS-0001PQ-9z for help-gnu-emacs@gnu.org; Mon, 27 Apr 2015 06:30:57 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:63005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmgJS-0001OH-4Y for help-gnu-emacs@gnu.org; Mon, 27 Apr 2015 06:30:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqUEADkPPlWkD4Xx/2dsb2JhbABc0lUCgXoBAQEBAQGBC4QhAQV5EAhJEARJE4gWARSzSYtQAYZEkD0HhC0FnA6HKo43I4I4gT48gnUBAQE Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 27 Apr 2015 12:26:42 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 25 Apr 2015 22:52:00 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104017 Archived-At: Stefan Monnier writes: > C-h f zerop RET says: > > zerop is a compiled Lisp function in `subr.el'. > [...] > This function has a compiler macro `zerop--anon-cmacro'. > > and if you look at this mysterious zerop--anon-cmacro, you'll see that > it optimizes `zerop' by rewriting it to (= 0 ...), which is implemented > more efficiently. IIUC the efficiency is obtained by inlining the definition thus avoiding a function call. What's the difference between using that compiler macro and using defsubst ? -- Nicolas