[Swift-devel] regexp_mapper redundant?

Ben Clifford benc at hawaga.org.uk
Tue Feb 3 05:26:36 CST 2009


It might be the case now that many of the mappings provided by 
regexp_mapper can be implemented using single_filename_mapper and @regexp 
and @filename.

Previously this did not work, I think because of lack of dataflow 
dependency handling in mapper parameters. However, that handling is in 
place now.

So perhaps it is the case that:

file f <regexp_mapper;source=s,match="(.*)gif",transform="\1jpg">;

is the same as:

file f <single_file_mapper;file=@regexp(@filename(s),"gif","jpg")>;

This isn't quite a complete replacment, because the @regexp function 
doesn't seem to support substitution groups like \1

It perhaps could be made to, though.

-- 




More information about the Swift-devel mailing list