[Python-Dev] Re: [Fwd: Discussion: Introducing new operators formatrix computation]
Gordon McMillan
gmcm@hypernet.com
Sat, 15 Jul 2000 10:17:20 -0400
Huaiyu Zhu wrote:
> The whole field of linear algebra is built on eight statements,
> two of them can be derived from the other. You can't even define
> all the concepts like upper or lower case, white space, tab,
> symbol, character and number and identifier and concatenation and
> so on in just eight statements, let alone to state all the rules
> of text processing.
You claimed elsewhere that these arguments were quoted out
of context, yet you bring them up again. So let's nail this,
alright?
Text processing doesn't use any new operators. It reuses
some arithmetic operators. Everything else is done with
methods or functions. If that's what a linear algebra extension
used, there would be nothing to discuss.
Or you could take something like the regex route:
pyLinearAlgebra.evaluate(r'(X`*X)\(X`*y)', X=X, y=y)
... and there would be nothing to discuss.
But you want new operators, and that's a can of worms. They
need to be spelled sensibly and in a way that doesn't conflict
with current Python punctuation / operators. They need
precedence rules built into the grammar. If the precedence
rules aren't right, the operators are damn near useless,
because it will take so many parens to get the right result,
you might as well be using one of the above techniques.
> The issue arises because one generalization is more familiar to
> one group of people but the other is to other people. And people
> tend to regard what they are not familiar with as "specific
> domain".
Python isn't a matrix manipulation language. Like any
language that does in-fix, adding operators is a tricky
business and affects everybody, whether they know it or not.
- Gordon