From: Rafael L. <lab...@mp...> - 2002-04-24 11:52:01
|
[GROSSMANN: Salut Etienne, :] [SF: Hi Octave-Smiths, :] * Etienne Grossmann <et...@is...> [2002-04-23 21:34]: > I've worked a little bit on "some sort of a preprocessor" that allows to > maintain many .m files with a single template. The idea is that many > functions with different synopsis and nearly the same internals would be > easier to maintain : > [...] There is a neat tool called slice (http://www.engelschall.com/sw/slice/) that does a similar job. The exemple in the POD section of your script, would work with slice like this: File foo.tpl: This is for all This is also for all [SIMPLE:hello world:] [OBSEQUIOUS:Your excellent highness, please accept my humble "hello":] That's again for all Command for generating the files: for i in SIMPLE OBSEQUIOUS do slice -o ${i}uUNDEF:foo_$(echo $i|tr A-Z a-z).txt foo.tpl done It is also possible to define output filenames from inside the template file. In this case: File foo.tpl: %!slice -o SIMPLEuUNDEF:foo_simple.txt %!slice -o OBSEQUIOUSuUNDEF:foo_obsequious.txt This is for all This is also for all [SIMPLE:hello world:] [OBSEQUIOUS:Your excellent highness, please accept my humble "hello":] That's again for all Command for generating the files: slice foo.tpl -- Rafael |