This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sub conditionals_true_when (@@) [PATCH]


Richard Boulton <richard@tartarus.org> writes:
> On Wed, Jun 13, 2001 at 11:44:52AM +0300, Kalle Olavi Niemitalo wrote:
>> This bug is also causing the @TRUE@ conditions reported by
>> Richard Boulton in "Bug with conditionals. [PATCH]".
> 
> You're right, this does seem to be the main cause of the problem I
> reported.
>
> I tried fixing the problem (by passing by reference instead).
[snip]
>  # $BOOLEAN
> -# &conditionals_true_when (@CONDS, @WHENS)
>+# &conditionals_true_when (\@CONDS, \@WHENS)
>  # ----------------------------------------
[snip]
>+sub conditionals_true_when ($$)
>  {
> -    my (@conds, @whens) = @_;
>+    my ($condsref, $whensref) = @_;

Isn't it cleaner to use 

  sub conditions_true_when(\@@)
  {
    my ($condsref, @whens) = @_;

You also get the benefit of type-checking.

> -	  if ! conditionals_true_when ((@parent_conds), ($vcond));
>+	  if ! conditionals_true_when ([@parent_conds], [$vcond]);

This would then be,

  if ! conditionals_true_when(@parent_conds, $vcond)

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]