[Numpy-discussion] New Operators in Python

Charles R Harris charlesr.harris at gmail.com
Sun Mar 25 20:32:01 EDT 2007


On 3/25/07, Bill Baxter <wbaxter at gmail.com> wrote:
>
> On 3/26/07, Steven H. Rogers <steve at shrogers.com> wrote:
> > Joe Harrington wrote:
> > >
> > > On the other hand, Python, IDL, and Matlab are attractive to us mainly
> > > because their syntaxes allow us to see the math, understand it on
> > > inspection, and verify its correctness.  The math we write in these
> > > languages looks as much like the math we do on paper as ASCII will
> > > allow.  (Obviously, we also choose them because we don't like writing
> > > loops and declaring variables.)
> > >
> > > So, whenever I hear someone suggest using a functional syntax for a
> > > concept that exists notationally, I cringe.  We're alienating a class
> > > of users each time we do that.  Those are people who will never come
> > > to Python.  There are extremes to which this argument cannot go - a
> > > prime will never be a derivative because quotes are more important -
> > > but I think that matrix multiplication is a no-brainer here.  We
> > > should let the Python developers know we want it now and then follow
> > > up with a syntax and implementation.
> > >
> > >
> >
> > Sun's Fortress programming language
> > (http://research.sun.com/projects/plrg/faq/index.html) will include
> > Unicode operators and two dimensional equations.  Something like this
> > should be possible for NumPy.  The question is how much can and should
> > be pushed into the Python core language.
>
> Until we get to the point that it's actually harder to find a
> non-Unicode console/editor than a Unicode one, I think the idea of
> using Unicode symbols as part of the syntax of a general purpose
> language is a bad one.
>
> I'm looking forward to see what becomes of Fortress, but it's
> basically still an experiment at this point.


What might work better is simply some sort of sign that causes a function to
be parsed as infix, x @dot y for instance, although Python already uses @
for other things. I don't know what symbols are left unused at this point,
maybe ! , $, and ~.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070325/bd9e5a9b/attachment.html>


More information about the NumPy-Discussion mailing list