[Top][All Lists]

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

Re: more m4sugar tweaks

From: Ralf Wildenhues
Subject: Re: more m4sugar tweaks
Date: Fri, 22 Aug 2008 16:02:42 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Eric,

slowly working my way forward through a review backlog:

* Eric Blake wrote on Wed, Jul 30, 2008 at 03:23:33PM CEST:
> 1. m4_for was inefficient; and now that m4 1.4.x makes a much heavier
> reliance on it, I decided to improve its speed.  One of the ways I made it
> faster was via a subtle semantic change; previously, each iteration used
> m4_indir([variable]) to read the current counter, and see if iteration
> should end.  This meant the user could modify the definition of variable
> to skip or replay iterations, potentially even entering an infinite loop.
> ~  The new implementation ignores user changes to variable, always
> performing as many iterations as was determined up front.

That's ok.  However, do we provide for a method that allows a for-like
loop which allows to mess with the iteration variable while looping?
Asking because that may allow for a "break"-like construct.  I'm not
asking you to implement this if we don't have it yet (a TODO item would
be fine), but if we do, hinting at it in the manual would be nice.  It
is not a problem if this method is slower than m4_for.


> >From 8f5c14ff9143fb53a395f1a5fad9429a4feac26e Mon Sep 17 00:00:00 2001
> From: Eric Blake <address@hidden>
> Date: Tue, 29 Jul 2008 12:21:25 -0600
> Subject: [PATCH] Optimize m4_for.
> * lib/m4sugar/m4sugar.m4 (m4_for): Use fewer macros.
> (_m4_for): Take additional parameter, for fewer m4_indir calls.
> * lib/m4sugar/foreach.m4 (_m4_foreach, _m4_shiftn, m4_do)
> (m4_reverse, _m4_list_pad, _m4_list_cmp): Adjust all callers.
> * doc/autoconf.texi (Looping constructs) <m4_for>: Document subtle
> semantic change caused by the optimization.
> * tests/ (M4 loops): Test the new semantics.
> Signed-off-by: Eric Blake <address@hidden>

reply via email to

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