New Science Discovery: Perl Idiots Remain Idiots After A Decade!New Science Discovery: Perl Idiots Remain Idiots After A Decade!
Tue Mar 13 12:00:55 CET 2012
On 3/12/2012 20:00, Albert van der Horst wrote:
> In article<4f5df4b3$0$1375$4fafbaef at reader1.news.tin.it>,
> Kiuhnm<kiuhnm03.4t.yahoo.it> wrote:
>> On 3/12/2012 12:27, Albert van der Horst wrote:
>>> 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.
>> You may see it this way:
>> Def1. An operator +:SxS->S is left-associative iff
>> a+b+c = (a+b)+c for all a,b,c in S.
>> Def2. An operator +:SxS->S is right-associative iff
>> a+b+c = a+(b+c) for all a,b,c in S.
>> Def3. An operator +:SxS->S is associative iff it is both left and
> I know, but what the mathematicians do make so much more sense:
> (a+b)+c = a+(b+c) definition of associative.
> Henceforth we may leave out the brackets.
That's Def3. I don't see your point.
> Don't leave out the brackets if the operators if the operators is
> not associative.
(1 - 1) - 1 != 1 - (1 - 1)
and yet we can leave out the parentheses.
> P.S. There is no need for the operators to be SxS->S.
> For example a b c may be m by n, n by l, l by k matrices respectively.
Ops, you're right.
More information about the Python-list