Hello Bruno, * Bruno Haible wrote on Mon, Nov 13, 2006 at 10:04:47PM CET: > Ralf Wildenhues wrote: > > the possibility to use the flexibility of m4 > > is helpful, both for implementing a testsuite environment, and deploying > > invidividual tests, once you're used to it. > > Details, please? With shell functions, you also have a lot of flexibility. > You can > - define functions depending on the platform (e.g. func_readlink, > func_echo), > - define variables which expand to shell functions or commands: > $echo "abc" > $verbose cp ... > What flexibility do you gain with m4?
Well, there isn't a whole world, once you allow shell functions. But for maintaining a repository of shell snippets in m4, you can get some cheap form of dependency resolution (a la AC_REQUIRE), some literal value optimization in special cases while maintaining interface consistency (esp. for some quoting issues this is quite useful), and typically you can achieve less redundance in the input files: shell functions are not always the most elegant way to eliminate duplications. Cheers, Ralf
