[Top][All Lists]

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

Re: problem: unitialized +=

From: Robert Collins
Subject: Re: problem: unitialized +=
Date: Wed, 18 Apr 2001 19:09:18 +1000

----- Original Message -----
From: "Akim Demaille" <address@hidden>
To: "Robert Collins" <address@hidden>
Cc: "Alexandre Oliva" <address@hidden>; <address@hidden>
Sent: Wednesday, April 18, 2001 7:00 PM
Subject: Re: problem: unitialized +=

> >>>>> "Robert" == Robert Collins <address@hidden>
> Robert> Is there are reason that the automate values cannot all be +=,
> Robert> with a flag to ignore the value completely if the user uses =
> Robert> not += ?
> Sorry, I don't understand what you mean.
> Robert> Without handling this in the intuitive fashion, I suspect +=
> Robert> will vary rarely get used.
> The thing is, you find this syntax attractive and suddenly you'd like
> to have this feature.  But that's not the problem, we are (well, I for
> one :) not proposing this feature, and we are precisely debating about
> the fact that supporting this syntax gives the wrong idea that there
> is some feature behind.

I can understand that. I hadn't initially realised that this _wasn't_ a
feature - I only tried to use += because I read it in the automake doco.
(I don't recall it differentiating user created targets and automake
created variables.

> This is why I had forbidden user variables first set by `+=': there
> cannot be any confusion.  And now that I rediscovered why it was this
> way, I think we should keep it this way.

You mention in another email that the semantics are hairy... Not knowing
the guts of automake, I can only throw peanuts. So I'll throw a single
peanut and then go get rid of the += in the's I've created.

The peanut is:

My suggestion for the semantics is:
conditionals are orthogonal to the difference between += and = for
automake generated variables.

ie whether foo_DEPENDENCIES is overridden in
if test

is _exactly_ the same logic as
if test

in both cases, foo_DEPENDENCIES is altered if test, and left as automake
created if !test.

because you always process each branch of the conditional, there is no
issue. Thus the expected behaviour should be very easy to describe.

if a given variable is altered by the user with =, at any point, the
automake value is discarded.
if a given variable is altered with += as the _first_ assignment, the
automake value is inserted before the user value.

Anyway, you guys are the experts, so I'll leave it up to you. Thanks for
looking at it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]