[MATRIX-SIG] reverse of take?

Andrew P. Mullhaupt amullhau@ix.netcom.com
Thu, 26 Jun 1997 22:44:59 -0400


At 04:24 PM 6/26/97 -0700, Phil Austin wrote:
>>>>>> "AM" == Andrew P Mullhaupt <amullhau@ix.netcom.com> writes:
>    AM> This kind of scatter
>    AM> is really neat and one of the attractions of the S language. S
>    AM> has by far the nicest syntax for indexing of all the array
>    AM> languages,

> At the moment I'm trying to
>translate various legacy S constructs into take, repeat, reduce
>combinations--it feels like I'm taking (and failing) some kind of IQ
>test.  

Emigrating from S is likely to be a frightening experience unless you
have experience with another interpreted language. Although python (with
Numerical Extensions) and S are actually very close in most respects, you
are likely to get hung up on the limited indexing of Python and the very
different semantics of argument processing _despite the identical syntax_.

Until something is done about the indexing you really ought to avoid
_transliterating_ S into python; rather you should recast the algorithm
into a more python-friendly form. Keep in mind that python loops are a
_lot_ less punitive than S loops, and although python uses an obsolete
approach to memory management, it is a _good_ implementation of that approach,
as opposed to S, which uses a combination of bad implementation and demented
design decisions to arrive at what may very well be the worst memory behavior
of any actually useful program. (Or, as my new Director of Technology put it,
"worst memory behavior of any actually useful program not used for testing
memory systems....") This means that you don't need to jump through some of
the same memory-saving hoops with python as with S, and this means that
explicit loops which  may contain temporary variables are not catastrophic,
as they are in S.

So although it is a pain to write all that code where a few index objects
used to suffice, python can usually get the job done. You're going to be in
a minority - you're coming to python programming from a language which
offers you a lot more in the way of comfortable operations than python
instead of coming from medieval torture chambers like C or Fortran, which
offer so much less. It does seem, though, that several people have
mentioned moving from S to python recently, so maybe it is a growing minority.

Some of us have thought about doing a data.frame class for python. Would
you be interested?

Later,
Andrew Mullhaupt

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________