automake
[Top][All Lists]
Advanced

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

Re: sub conditionals_true_when (@@) [PATCH]


From: Richard Boulton
Subject: Re: sub conditionals_true_when (@@) [PATCH]
Date: Thu, 14 Jun 2001 22:55:27 +0100
User-agent: Mutt/1.2.5i

On Thu, Jun 14, 2001 at 03:17:38PM -0500, Raja R Harinath wrote:
> Isn't it cleaner to use 
> 
>   sub conditions_true_when(\@@)
>   {
>     my ($condsref, @whens) = @_;
> 
[snip]
> 
> >-      if ! conditionals_true_when ((@parent_conds), ($vcond));
> >+      if ! conditionals_true_when (address@hidden, [$vcond]);
>
> This would then be,
> 
>   if ! conditionals_true_when(@parent_conds, $vcond)

This bit may be neater, but in variable_conditions_reduce() we have a
scalar to pass as the first argument, rather than an array.  \@ prevents us
from using an anonymous array, so we need a temporary variable, or to
restructure the code in variable_conditions_reduce() to use an array all
the time.  I can't see a good way to do this restructuring, and therefore
think this balances out the other neatness by itself.

It also seems cleaner to me to treat both arguments the same, since they
both have the same type.  But maybe that's just because I'm a C coder more
than a perl coder.

There's no good reason not to do:
if ! conditionals_true_when (address@hidden, [$vcond]);
though, now you mention it. ;-)

-- 
Richard



reply via email to

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