Bug in __imul__

Roman Suzi rnd at onego.ru
Wed Jul 11 16:52:02 CEST 2001


On Wed, 11 Jul 2001, Alex Martelli wrote:

>"Emile van Sebille" <emile at fenx.com> wrote in message
>news:9ihg33$irjha$1 at ID-11957.news.dfncis.de...
>> Does it bother anyone that
>> a *= 3 + 4
>> returns a different value from
>> a = a * 3 + 4

By this example I conclude that infix notation is seriously flawed
compared to prefix or postfix (called Polish and inverted Polish).

You have no chance to mess with postfix:

3 4 + a *=

or even with:

3 4 + 5 *

;-)

So, GvR should consider phasing infix out ca Python 2.6. With postfix, you
will have much more freedom to express youself. For example,

a div b  or div(a, b) will be non-issue:

a b div

And also the border between operations and functions cease to exist:

a b +
a b add

And it is also easier for beginners: they will not need to remember all
those rules of precedence, association, priority, ( ) spilled here and
there. All they will need, is to put their numbers in order:

a b c + *

will be no more complex than:

a b * c +

Instead of:

a * (b + c)

and

a * b + c  or (a * b) + c  , who knows?

What? This is inconsistent with math notation? Who cares to know it these
days! You do not need to be rocket scientist (or any scientists at all) to
write simple arithmetics!

;-)

Oh, yes. I forgot to mention that in childhood I had a programmable
calculator with postfix notation. And I really learned to program with it.

Sincerely yours, Roman Suzi

P.S. Going to write Fython ;-)
(F for Forth)
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Wednesday, July 11, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "186,000 miles/sec: Not just a good idea, it's the LAW." _/





More information about the Python-list mailing list