Re: Python's simplicity philosophy

From: Dave Benjamin (ramen_at_lackingtalent.com)
Date: 12/06/03


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 :


Relevant Pages

  • Re: Case sensitivity in programming languages.
    ... Every time someone creates a post about case sensitve languages I reserve ... At least not in PHPP, ... Thus I can create different things called 'foo' and reference each ... sensitive languages trying to force case sensitivity into ALL languages. ...
    (comp.lang.php)
  • Re: PHP as a secure language? PHP worms? [was: Re: new linux malware]
    ... _Programming Languages: Concepts and Paradigms_ he defines some of the paradigms of programming languages; on pp 12-13, ... This book is classic but doesn't list Perl or PHP or Java -- but the concepts are the same. ...
    (Bugtraq)
  • Re: Php invented by a former DECcie ?
    ... Dijkstra would have said about these languages as compared to his ... PHP does not even have a goto statement. ... It's not the perfect scripting language but it has gotten a lot better over the years. ... If Perl or PHP will get it done faster that's what you use. ...
    (comp.os.vms)
  • Re: PHP global namespace clogged up
    ... Only a bad programmer would confuse the two. ... PHP does not have linking. ... > This is why most programming languages have namespaces - and use them. ... None of the languages I have used in the past 30 years have had namespaces. ...
    (comp.lang.php)
  • Re: PHP global namespace clogged up
    ... This is why most programming languages have namespaces - and use them. ... > PHP functions do not need all that bloat to work, so again I say "it is not ... The benefits of OO design mainly show up when building large projects, ...
    (comp.lang.php)