Bug or intended behavior?

Chris Angelico rosuav at gmail.com
Thu Jun 15 09:58:33 EDT 2017


On Thu, Jun 15, 2017 at 11:37 PM, bob gailer <bgailer at gmail.com> wrote:
> Slight OT digression: The language that is best for me is APL in which there
> is no operator precedence to worry about. Execution is strictly
> right-to-left. () are used when the order of evaluation needs to be altered.
> I recall one person telling me that "right-to-left" was not natural. He
> preferred "left-to-right" as in FORTRAN. So I considered the FORTRAN
> statement A = B + C * D. Turns out that A * B happens first, then C + then A
> =. Sure looks right-to-left to me!

Did you learn about the basic algebraic order of operations in grade
school? Multiplication happens before addition. Sane programming
languages respect this.

(Not counting those that don't use infix operators. Prefix or postfix
operators follow different rules.)

ChrisA



More information about the Python-list mailing list