From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b7fa6b1 1/4: Simplify use of FOR_EACH_TAIL Date: Mon, 06 Feb 2017 17:37:32 +0200 Message-ID: <83inon72kj.fsf@gnu.org> References: <20170205213033.19755.8264@vcs.savannah.gnu.org> <20170205213034.20306220171@vcs.savannah.gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1486397236 24809 195.159.176.226 (6 Feb 2017 16:07:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2017 16:07:16 +0000 (UTC) Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 17:07:12 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 1calot-0006Bm-WD for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 17:07:12 +0100 Original-Received: from localhost ([::1]:49233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caloz-0001RA-Iv for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 11:07:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1calML-0002UA-Ku for emacs-devel@gnu.org; Mon, 06 Feb 2017 10:37:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1calMI-0002dX-Gw for emacs-devel@gnu.org; Mon, 06 Feb 2017 10:37:41 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1calMI-0002dO-Du; Mon, 06 Feb 2017 10:37:38 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4576 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1calMF-0008Hb-RM; Mon, 06 Feb 2017 10:37:36 -0500 In-reply-to: (message from Paul Eggert on Sun, 5 Feb 2017 21:23:43 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:212037 Archived-At: > From: Paul Eggert > Date: Sun, 5 Feb 2017 21:23:43 -0800 > > Lisp_Object tail; > FOR_EACH_TAIL (tail, list) > if (EQ (XCAR (tail), elt)) > return true; > > but this was annoying both because the user must declare 'tail', and because > typically 'tail' should not survive the loop but the declaration forces it to > survive. Why is it so important to make sure it doesn't survive the loop? If for optimizations, then I'd expect modern compilers to be smart enough to produce the same code whether it does or doesn't survive. We have similar macros elsewhere, e.g. FOR_EACH_FRAME, FOR_EACH_BUFFER, etc. It's IMO a pity to have this one different.