tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: I need support with a planned POSIX make extension



On Mon, Aug 02, 2021 at 06:42:14PM +0200, Joerg Schilling wrote:
 > Do you believe that POSIX should include a method to control whether $$ is 
 > expanded with := or not?

I don't know the history of this (or at least, not without going and
raking it up) but I'd say that $$ should never be expanded except at
the final output stage. The purpose of $$ is to produce $ in the
output, not cater to monstrosities like $$$$$$$$(VAR) that depend on
knowing exactly how many and which eval stages are going to be applied
to your text.

Because evaluation/expansion in make traditionally repeats until it
converges (as opposed to sh where it happens exactly once and you need
to play games with eval to do complicated things) it's a bad idea to
encourage or even allow constructions whose meaning depends on how
many eval passes happen. We've had various bad experiences along these
lines and have had to fix bmake to avoid them.

I'm also kind of skeptical, since the issue is lazy vs. eager
evaluation, that more varieties of assignment operator are going to do
anything to improve the situation.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index