Re: An alternative to sufreplace

Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
On Sunday 17 August 2003 16:52, Bram Moolenaar wrote:
> Adriaan de Groot wrote:
> > The attached patch adds suffixmangle() to the library of AAP-specific
> > Python functions. It acts like a kind of list-lifted sufreplace() -
> > you give it a list of replacements and it does them. The calling form
> > is

> The functionality of this function comes very close to sufreplace().
> It's not clear to me why you want it to work differently.

When I wrote it, sufreplace() was still broken when you passed it lists of 
files with attributes (leavign a trailing }). In the end, it is no different 
from nested sufreplace(), so it's not _that_ useful an addition, except in 
terms of shortness-of-expression.

> Passing a list of tuples makes it very Pythonesque.  Just passing a

Heh, and here I went out of my way to write something that fits in the Python 
idiom. I figured that [ (a,b),(c,d),(e,f) ] would be easier to check for 
correctness for the user than [ a,c,e ], [ b,d,f ] --- same number of 
elements in each? Is the order the right one?

Anyway, as long as I'm the only one who needs to do lots of sufreplaces(), 
I'll keep it in my recipes and not elsewhere.

-- 
pub  1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <[email protected]>
     Key fingerprint = 934E 31AA 80A7 723F 54F9  50ED 76AC EE01 FEA2 A3FE



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.