On Sat Oct 31 19:25:40 2015, tnmur...@gmail.com (Tim Murphy) wrote: > Hi, > > I'm implementing some new GNU make functions as loadable modules and I just > wondered if anyone had thoughts about how it would be best to implement > some of them.
[...] > As I was implementing this, however, I thought: why not add a list of > numbers? > > e.g. > $(add 1 2 3 -1 1) I like this, to me it seems to fit more naturally with existing functions. As the name I would use 'sum': 'add' suggests only twp arguments and suggests that one of them is modified, neither of which is the case. > This might turn out to be much more generally useful. e.g. adding a list > of file sizes together or something similar. Is this a good idea? It would be even more general to add higher-order functions (map, fold). Don't create a bag of functions, create a Lisp. > I also think that some numeric comparison functions might be handy e.g. > $(gt x,y) and $(lt x,y) plus the other obvious variations. Is there > anything else worth putting in? To be honest, I'm conflicted about functions being present at all. Originally, make was on an equal footing with the shell: it just created the execution logic, with all the real work being delegated to executables. It makes sense to add computing power on the values of variables, like bash did, but I'd avoid adding all kinds of specific functions just because they are useful - that will become ugly, you'd never stop adding more functions, just like it happened in Perl 4 and PHP. It seems more useful to focus on general, extension mechanisms that would allow makefile writers to easily add their own functionality; for instance (just thinking out loud), a way could be added to directly call the main() function of arbitrary compiled executables so as to avoid the fork(). > Regards, > > Tim -- Reinier Post _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make