[PYTHON MATRIX-SIG] Ranks and pseudo indices

Hinsen Konrad hinsenk@ere.umontreal.ca
Thu, 7 Dec 1995 14:34:11 -0500


   > variable. In fact these can be handled in Python -- as opposed to
   > Yorick -- by remembering that a[x,y,z] is really just a shorthand for
   > a[(x,y,z)] and that the index tuple can be constructed from an
   > expression, but that seems more like an implementation accident than a
   > feature to me.

   Actually, I do think that this is a feature, but I'd be curious for a good  
   example of a case of this.

OK, let's make it a feature. I can't remember an example right now, 
but I know that I used variables to specify ranks in J a few times.

Besides, my philosophy is the opposite: there should be good arguments
for restrictions, not for generality. Sooner or later someone will
reach the limits of everything, so you should not impose narrow limits
arbitrarily just because you can't think of any problem affected by
them.

   > between functions and arguments. The current matrix module allows
   > a second parameter to reduce() that indicates the axis, which is
   > exactly how APL handles the problem.

   I don't think that you're actually complaining about my current solution to  
   this problem are you?

In the sense of being restrictive, yes. Many APL users have found this
handling of reduction restrictive, which is why J's rank scheme is
generally appreciated, even by those who are put off by J's other
features.

   This is unfortunate, but unless I hear of many more of these problems, I  
   don't expect this to go away any time soon.  It's REALLY hard to add in  
   function of finite rank to the Optimized FUNCtion scheme I'm currently  
   using.  I spent a week and a half trying to make this happen and wound up  

I confess that I have never looked at their implementation, but I
don't see where the problem is. It is even possible to implement
the mapping from finite-rank functions to unbounded-rank functions
in Python relatively easily, but that means for-loops and the
associated loss of efficiency.
I'll see if I can figure out how the OFUNCs work.

   with an ugly useless mess.  Since I can imagine very few cases where this  
   sort of behavior is important, I'm very tempted to leave ofuncs as they are  
   right now, only operating on unbounded functions.

If you want more cases, try to locate an archive of comp.lang.apl of
the time when J came out. There were long discussions about the merits
of the rank system back then.

-------------------------------------------------------------------------------
Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. Centre-Ville     | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)
-------------------------------------------------------------------------------

=================
MATRIX-SIG  - SIG on Matrix Math for Python

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