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

Re: Accumulator

   Date: Thu, 23 May 2002 11:09:30 -0700
   From: Paul Prescod <paul@prescod.net>
   To: Pixel <pixel@mandrakesoft.com>
   CC: ll1-discuss@ai.mit.edu
   Subject: Re: Accumulator
   Pixel wrote:
   > ...
   > well, you didn't talk about "reduce". The main pb with list
   > comprehensions is that they are limited to giving lists as a result.
   reduce is used roughly once in the 50,000 lines of code that are the
   Python standard library. It clearly is not pulling its weight. In a
   project I worked on with six different Python programmers, ranging in
   expertise from guru to newbie, nobody used it once.

This is interesting data, and an interesting follow-up
questions would be:  Are there any places in that 50,000
lines of code where reduce *could* have been used but some
other programming idiom was used instead?  And, if so, what
are the reasons that other idioms were used instead of reduce?

I ask this question because I have seen a fair amount of
Lisp code where REDUCE could have been used but the programmer,
more comfortable with another idiom, chose to use LOOP or to
write his own recursive or iterative procedure.

--Guy Steele