On 08/03/2011, at 11:47 PM, Bruno Le Floch wrote:

> Thank you Joseph for the quick bug fix. Let me propose the following
> code for inclusion. The idea is similar to `\prg_new_map_functions`,
> which defines a set of maps, some of which are expandable. Namely,
> 
> \tl_gset_replacer:nnn {<name>} {<item1>} {<item2>}

As an aside, based on the name of \prg_new_map_functions:Nn I think \prg_new_replace_functions:Nn would be better.

> defines expandable replacement functions:
> 
> \<name>_replace_aux:nwwn
> \<name>_replace_some:nn
> \<name>_replace_one:n
> \<name>_replace_all:n
> 
> which are all `f`-expandable.

This sounds pretty good to me. How useful is the _some function? I'd be happy without it.
Anyway, I'd vote for adding this to expl3.

-- Will