emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master b7fa6b1 1/4: Simplify use of FOR_EACH_TAIL


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] master b7fa6b1 1/4: Simplify use of FOR_EACH_TAIL
Date: Mon, 06 Feb 2017 17:37:32 +0200

> From: Paul Eggert <address@hidden>
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]