Re: Python's simplicity philosophy
eichin@metacart a.com wrote:
...[color=blue]
> that kind of array handling. But the point here is that "reduce" is
> fundamental: x/i5 (where x is multiplication-sign and i is iota) is
> a lot like reduce(int.__mu l__, range(1,6)), it's just "readable" if[/color]
I disagree about "is a lot like" -- I think Numeric Python's
mul.reduce(arra yrange(1, 6))
is much closer to APL (sure, spelling "iota 5" as "arrayrange (1, 6)"
may be alien, but the point is that .reduce in Numeric, like / in APL,
is a property of OPERATORS [ufuncs, in Numeric], NOT a generic FP
tool like Python's built-in reduce).
[color=blue]
> of poking around.) On the other hand, that readability does assume
> you're thinking in terms of throwing arrays around, which can be
> an... *odd* way of looking at things, though of course when it fits,
> it's very nice.[/color]
That's the reason I'm happier to have it in a separate package, be
it Numeric or its successor numarray, than built into the language --
just like, e.g., regular expressions are a separate module in Python
but built into languages such as Perl or Ruby. Keeping the core
language simpler and other modules/packages rich is a strategy which
I think Python uses to excellent effect.
Alex
eichin@metacart a.com wrote:
...[color=blue]
> that kind of array handling. But the point here is that "reduce" is
> fundamental: x/i5 (where x is multiplication-sign and i is iota) is
> a lot like reduce(int.__mu l__, range(1,6)), it's just "readable" if[/color]
I disagree about "is a lot like" -- I think Numeric Python's
mul.reduce(arra yrange(1, 6))
is much closer to APL (sure, spelling "iota 5" as "arrayrange (1, 6)"
may be alien, but the point is that .reduce in Numeric, like / in APL,
is a property of OPERATORS [ufuncs, in Numeric], NOT a generic FP
tool like Python's built-in reduce).
[color=blue]
> of poking around.) On the other hand, that readability does assume
> you're thinking in terms of throwing arrays around, which can be
> an... *odd* way of looking at things, though of course when it fits,
> it's very nice.[/color]
That's the reason I'm happier to have it in a separate package, be
it Numeric or its successor numarray, than built into the language --
just like, e.g., regular expressions are a separate module in Python
but built into languages such as Perl or Ruby. Keeping the core
language simpler and other modules/packages rich is a strategy which
I think Python uses to excellent effect.
Alex
Comment