Re: An alternative to sufreplace
Bram Moolenaar <[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
Adriaan de Groot wrote: > 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. I thought you were going to make a patch to improve how sufreplace() works. Are you still going to do that? You can understand it will help more people, while your private function in your recipe won't get a wide audience. :-) -- "The question of whether computers can think is just like the question of whether submarines can swim." -- Edsger W. Dijkstra /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html /// ------------------------------------------------------- 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