automake
[Top][All Lists]
Advanced

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

Re: 81-lang-extensions.patch


From: Raja R Harinath
Subject: Re: 81-lang-extensions.patch
Date: 23 Mar 2001 10:10:23 -0600
User-agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/21.0.100

Hi,

Akim Demaille <address@hidden> writes:
> +    while (my ($attr, $value) = each %option)
>      {
[snip]
> +      if ($attr eq 'ansi')
>       {
> +       $lang_obj->ansi ($value);
>       }
> +      elsif ($attr eq 'autodep')
>       {
> +       $lang_obj->autodep ($value);
>       }
> +      elsif ($attr eq 'compile')
> +     {
> +       $lang_obj->compile ($value);
> +     }
[snip]

Wouldn't this be more compact and readable without the loop?

  $lang_obj->ansi    ($options{'ansi'})    if exists $options{'ansi'};
  $lang_obj->autodep ($options{'autodep'}) if exists $options{'autodep'};
  $lang_obj->compile ($options{'compile'}) if exists $options{'compile'};
  # ...

  delete $options{$_} for (('ansi', 'autodep', 'compile', ...));
  complain(...) if (keys %options);

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



reply via email to

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