> >>> [$9 *], m4_argn([8], m4_shift2($@))) dnl OpenBSD m4 can't count > > > > Can you please give a minimal example of an m4 input > > that demonstrates the problem? If something as fundamental > > as counting the number of arguments is broken, > > it needs fixing of course, instead of having > > software have to work around that. > > Sure. Run m4 over the below. It should print '10' three times. >
$ cat in divert(-1)dnl changequote([, ]) define([dquote], [[$@]]) define([argn], [pushdef([_$0], [popdef([_$0])]dquote([$]incr([$1])))_$0($@)]) define([foo], [argn([10], $@)]) define([bar], [argn([9], shift($@))]) define([baz], [argn([8], shift(shift($@)))]) define([numbers], [[1], [2], [3], [4], [5], [6], [7], [8], [9], [10]]) divert(0)dnl foo(numbers) bar(numbers) baz(numbers) $ m4 in 101 90 10 Thanks, I'll look into that. _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel