Matlab vs Python (was RE: Discussion: Introducing new operators f
cookedm at physics.mcmaster.ca.bbs
cookedm at physics.mcmaster.ca.bbs
Mon Jul 17 17:50:02 EDT 2000
More information about the Python-list mailing list
Mon Jul 17 17:50:02 EDT 2000
- Previous message (by thread): Matlab vs Python (was RE: Discussion: Introducing new operators f
- Next message (by thread): Matlab vs Python (was RE: Discussion: Introducing new operators f
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At some point, hzhu at localhost.localdomain (Huaiyu Zhu) wrote: > On Mon, 17 Jul 2000 14:12:02 -0500, Paul Prescod <paul at prescod.net> wrote: > > >Maybe you should consider how to scale back your syntactic request. > >Perhaps a single keyword or symbol at the beginning of an expression > >could make it element-wise or matrix-wise. > > Well, that would be fine if it is workable, ie, when they don't appear in > the same expression. > > Consider the proposal of having two classes, Matrixwise and Elementwise, > with methods to cast to each other. I don't know why > > (a.E()*b.E()).M()*(c.E()*d.E()).M() > > would be more preferable to > > (a.*b)*(c.*d) Well, it doesn't have to be as complicated as your first example. Assume the default is Matrixwise, and we get rid of some ()'s by overriding __getattr__, so that we can right (a.E*b.E)*(c.E*d.E) Better? It's not great, you have to remember to put .E on both. Ahh! But what if we assume that if one operand has .E, the other does also! Then we can write (a.E*b)*(c.E*d) which is two characters more than your second example. -- |>|\/|< ---------------------------------------------------------------------------- David M. Cooke cookedm at mcmaster.ca
- Previous message (by thread): Matlab vs Python (was RE: Discussion: Introducing new operators f
- Next message (by thread): Matlab vs Python (was RE: Discussion: Introducing new operators f
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list