Re: We know what you need, and we'll push it down your throat.

[prev] [thread] [next] [lurker] [Date index for 2006/12/23]

From: Michael Poole
Subject: Re: We know what you need, and we'll push it down your throat.
Date: 13:44 on 23 Dec 2006
Smylers writes:

> Abigail writes:
>
>> On Fri, Dec 22, 2006 at 05:15:15PM +0000, Smylers wrote:
>> 
>> > Abigail writes:
>> > 
>> > > On Fri, Dec 22, 2006 at 05:18:45PM +0100, Juerd wrote:
>> > > 
>> > > > But the following set of wishes clashes heavily:
>> > > > 
>> > > > - () can be used for grouping (to override precedence)
>> > > > - () can be used to enclose subroutine arguments
>> > > > - subroutines can also be used without ()
>> > > 
>> > > Perl5 had no problem coping with those rules
>> > 
>> > Yes it does.  Perl 5 suffers ...
>> > 
>> >   print (3 + 4) * 6;
>> > 
>> > ... is treated as:
>> > 
>> >   (print 3 + 4) * 6;
>> > 
>> > That's hateful!
>> 
>> No, it's not.
>
> Yes it is!  It trips people up in practice.  Multiplication is supposed
> to be commutative, yet interchanging its operands can yield a different
> result.

It is just operator precedence, which already makes multiplication
non-commutative if you ignore it.  C also makes "f (b) * c" different
than "f c * (b)", although its semantics are less surprising (unless,
perhaps, c is parenthesized as well).  Is that hateful in C?

Michael
There's stuff above here

Generated at 03:02 on 01 Jan 2007 by mariachi 0.52