Re: Python's simplicity philosophy
From: Dave Benjamin (ramen_at_lackingtalent.com)
Date: 12/06/03
- Next message: Peter Hansen: "Re: Lists and Tuples"
- Previous message: CK: "Re: thread vs threading -- Unexpected Results"
- In reply to: Douglas Alan: "Re: Python's simplicity philosophy"
- Next in thread: Arthur: "Re: Python's simplicity philosophy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 06 Dec 2003 03:47:51 -0000
In article <lcekvjaenb.fsf@gaffa.mit.edu>, Douglas Alan wrote:
> Lots of languages don't provide reduce() and lots of languages do. Few
> provide sum(). Higher-order functions such as reduce() are
> problematic in statically typed langauges such as C, C++, or Java,
> which may go a long way towards explaining why none of them include
> it. Neither C, C++, or Java provide sum() either, though PHP provides
> array_sum(). But PHP has a huge number of built-in functions, and I
> don't think that Python wishes to go in that direction.
Not that this contributes much to either side of this argument, but I just
want to mention that PHP *does* have a reduce function:
http://www.php.net/array_reduce
However, this requires pass-by-name and PHP has no support for closures, so
its usefulness is somewhat limited. PHP also has array_map() and
array_filter(), which do what you might expect...
Ducking out now,
Dave =)
-- .:[ dave benjamin (ramenboy) -:- www.ramenfest.com -:- www.3dex.com ]:. : d r i n k i n g l i f e o u t o f t h e c o n t a i n e r :
- Next message: Peter Hansen: "Re: Lists and Tuples"
- Previous message: CK: "Re: thread vs threading -- Unexpected Results"
- In reply to: Douglas Alan: "Re: Python's simplicity philosophy"
- Next in thread: Arthur: "Re: Python's simplicity philosophy"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|