New Science Discovery: Perl Idiots Remain Idiots After A Decade!New Science Discovery: Perl Idiots Remain Idiots After A Decade!

Albert van der Horst albert at spenarnc.xs4all.nl
Mon Mar 12 12:27:25 CET 2012


In article <0078bbfb-5dfc-48fc-af1a-69de3cf15c3e at b1g2000yqb.googlegroups.com>,
Xah Lee  <xahlee at gmail.com> wrote:
>New Science Discovery: Perl Idiots Remain Idiots After A Decade!
>
>A excerpt from the new book =E3=80=88Modern Perl=E3=80=89, just published, =
>chapter 4
>on =E2=80=9COperators=E2=80=9D. Quote:
>
>=C2=ABThe associativity of an operator governs whether it evaluates from
>left to right or right to left. Addition is left associative, such
>that 2 + 3 + 4 evaluates 2 + 3 first, then adds 4 to the result.
>Exponentiation is right associative, such that 2 ** 3 ** 4 evaluates 3
>** 4 first, then raises 2 to the 81st power. =C2=BB
>
>LOL. Looks like the perl folks haven't changed. Fundamentals of
>serious math got botched so badly.

You're confused.

Associativity of operators is defined in mathematics.
(The same concept may be used in programming).
"left-associativity" and "right-associativity" are computer languages
concept and their definitions are not from mathematics.

Interestingly in mathematics associative means that it doesn't matter
whether you use (a.b).c or a.(b.c).
Using xxx-associativity to indicate that it *does* matter is
a bit perverse, but the Perl people are not to blame if they use
a term in their usual sense.

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert at spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst




More information about the Python-list mailing list