automake-patches
[Top][All Lists]
Advanced

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

Re: FYI: 6/ Automake::Variable & Automake::VarDef


From: Raja R Harinath
Subject: Re: FYI: 6/ Automake::Variable & Automake::VarDef
Date: Wed, 18 Jun 2003 15:44:38 -0500
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Hi,

Alexandre Duret-Lutz <address@hidden> writes:

>>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:
>
> [...]
>
>  Hari> Can we eliminate the use of 'variable_defined' and just
>  Hari> use 'var' in there?  
>
>  adl> Yes, that sounds sensible.
>
>  adl> Perhaps it would also be a good reason to drop the
>  adl> "rule-vs-variable" diagnostic (which is currently commented out
>  adl> in variable_defined).  This diagnostics only causes
>  adl> implementations issues, and I suspect it doesn't help anybody.
>
> Here is my attempt at doing so.  I'm not as satisfied as I
> thought I would.
>
> First, the old `variable_defined' really did two things:
>   (1) telling whether a variable exists
>   (2) marking a variable as examined (in one condition if given,
>       or all conditions otherwise).
>
> (1) can easily be replaced by `var', but (2) cannot be merged in
> Indeed, var/rvar is the main access to all variables; marking FOO
> as examined in condition 'C1' should be done with 
>   rvar ('FOO')->rdef ('C1')->set_seen
> but that would be meaningless if rvar('FOO') already had marked
> 'FOO' as examined in all conditions.
>
> What I've done is moving (2) into a separate function, Variable::set_seen,
> so you can call
>   rvar ('FOO')->set_seen
> to mark a variable as examined in all conditions.

Isn't there already an API for this: 'examine_variable'.  Why a new name?

[snip]
>   if (set_seen ('some_SOURCES'))
>     ...

  if (examine_variable ('some_SOURCES'))

> Now, it looks like I'm back to the beginning, having just
> renamed variable_defined into set_seen.  That's partly true, and
> that's why I'm baffled by this change.  That's partly wrong too:
> by replacing variable_defined by either `var' or `set_seen', the
> code is now more clear about which variables need to be marked
> as examined.

I think this is better, too.

- Hari
-- 
Raja R Harinath ------------------------------ address@hidden




reply via email to

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