3 ms·
Here is Awk with C99 preprocessing: cppawk! Loop macro for parallel/nested iteration featuring a (user-extensible!) vocabulary of clauses: $ cppawk ' #inc
by kazinator 4y ago
Here is Awk with C99 preprocessing: cppawk!
Loop macro for parallel/nested iteration featuring a (user-extensible!) vocabulary of clauses:
$ cppawk '
#include <cons.h>
#include <iter.h>
BEGIN {
loop (list(iter0, item, list("alpha", "charlie", "bravo")),
list(iter1, ltr, list("a", "b", "c")),
range(i, 1, 3))
{
print item, ltr, i
}
}'
alpha a 1
charlie b 2
bravo c 3
This is a tiny shell script plus a collection of header files in a small directory structure. It requires an Awk such as GNU Awk, and the GNU C preprocessor.
Preprocessed programs cam be captured, to run on systems that don't have the cppawk script or a preprocessor, and with less startup overhead.
https://www.kylheku.com/cgit/cppawk/about/ https://www.kylheku.com/cgit/cppawk/about/