Re: [A-A-P-develop] An alternative to sufreplace
Brought to you by:
vimboss
From: Adriaan de G. <ad...@cs...> - 2003-08-19 07:53:07
|
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 <gr...@kd...> Key fingerprint = 934E 31AA 80A7 723F 54F9 50ED 76AC EE01 FEA2 A3FE |