[Top][All Lists]

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

Re: PATCH: Simplify a few loops in lib/Automake

From: Raja R Harinath
Subject: Re: PATCH: Simplify a few loops in lib/Automake
Date: Tue, 12 Aug 2003 18:28:27 -0500
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)


Alexandre Duret-Lutz <address@hidden> writes:

> Does anybody knows how to tell Gnus to quote attachments?  Each
> time I want to comment a patch which is attached to a play I've
> to play copy/paste.

I just '2 b' to show it inline.  Then I hit 'R', and lo-n-behold the
patch is quoted.  Doesn't that work for you?

>>>> "Hari" == Raja R Harinath <address@hidden> writes:
>  Hari> Hi,
>  Hari> A few of the 'foreach' loops are simple enough that they can be
>  Hari> replaced with one-liner 'map's or 'grep's.
>  Hari> Ok to apply?
> Sure!  
> Personally it takes me more time to understand a map statement
> such as the one you put in sub_conditions than its equivalent
> for loop, though.  But well, I guess I have to fix my brain :)

Actually, I can simplify:

  my @res = map { $_->false ? () : $_->strip ($subcond) } @prodconds;
  return new Automake::DisjConditions @res;


  my @res = map { $_->strip ($subcond) } @prodconds;
  return new Automake::DisjConditions @res;

Automake::DisjConditions::strip is a no-op on FALSE, and
Automake::DisjConditions::new will take care of discarding FALSE.

Otherwise, I think it's pretty idiomatic Perl: you'll have to wrap
your brain around it sometime, might as well now ;-)

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

reply via email to

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