On 05/08/2014 12:32 PM, Daniel Goldman wrote: > But if the sequence already contains strings, cpp "knows" to escape the > internal double quotes, m4 apparently does not:
But GNU m4 has the ability to regex replacement, so you can define your m4 macro to use regexp to convert all " in the input to be \" in the output, before adding your surrounding "" around the result. > Thanks again. Any other differences anyone might suggest, basic > capabilities cpp can do that m4 cannot do? None. m4 is Turing complete - and therefore it can do anything (just not necessarily efficiently). cpp can be abused to emulate Turing completeness, although it is even hairier than m4's Turing completeness: https://stackoverflow.com/questions/3136686/is-the-c99-preprocessor-turing-complete -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
