On Wed, 2020-05-20 at 11:48 -0500, Pete Dietl wrote: > Another option would be to introduce some new syntax like $(()), > but that might break existing Makefiles and would probably be more > work, though it looks cleaner IMO.
No, I don't agree with that. Trying to change the base make parser like that would be a major source of issues. There is already a simple way to hook in a new make function, and any new capabilities need to fit within the current function invocation model rather than creating brand-new top-level syntax. > > Grouping: do we try to implement expression grouping with () (e.g., > > $(expr (1 + 1) * 4) or is it good enough to just say people need to > > nest expr functions: $(expr $(expr 1 + 1) * 4)? > > I think nesting `expr` is too noisy. We need to find a good balance between implementation complexity and "noisy use". Remember that GNU make has existed for 30+ years without any math operations at all! Although some simple math operations would be useful in many situations and improve portability by avoiding the need to shell out, no one is going to be implementing MATLAB in a makefile. My point is, it's not necessary for this to have the most beautiful, streamlined syntax because it will appear only in a few places, and in relatively simple contexts. If it's easier to fall back on make's existing expansion facilities than to implement grouping, we should fall back.