Adding new math operators

Jeff Petkau jpet at eskimo.com
Sat Aug 5 15:42:55 EDT 2000


> >What if there were no new operators, no new syntax, but
> >instead a new module that used excessive cleverness to
> >translate Python expressions into MathML, which was
> >then displayed in emacs/Idle/PythonWin as Real Math?
>
> Though I love to use markup languages for typesetting, I wouldn't use them
> for programming.  You are looking at the source code most of the time
> instead of whatever transformed results.  Only WYSIWYG works for programs.

I wasn't thinking of programming in MathML, just using it (or even
TeX or whatever) to get consistent expression formatting across
editors. If you've ever used Macsyma, it does exactly what I was
thinking of. You enter an expression like

    sum(1/x^2,x,0,inf)

and it displays in mathematical notation. But as someone else pointed
out, this would require you to be aware of two notations, and it's sort
of philosophically opposed to the whole one-way-to-format-your-code
idea. Oh well.

Ok, a much simpler idea: how about named operators with a standard
mapping from names to unicode?

So using the infix notation someone suggested a while back:

    b = a ..innerp.. (b ..outerp.. c)
    N ..dot.. P + V = 0

and the editor could substitute a glyph for ..dot.., but keep the expression
formatting.

Hmm, probably needs a whole new language. Oh well.

--Jeff






More information about the Python-list mailing list