Re: My operator can beat up your operator.
Re: My operator can beat up your operator.
- Subject: Re: My operator can beat up your operator.
- From: John W Baxter <email@hidden>
- Date: Tue, 13 May 2003 22:49:41 -0700
- Envelope-to: email@hidden
At 13:34 -0700 5/12/2003, Christopher Nebel wrote:
>
Whether you find it intuitive, ridiculous, or otherwise, standard
>
algebraic practice is that exponentiation has higher precedence than
>
negation, so without parentheses, -3^2 comes out to -9, not 9.
>
>
AppleScript does *not* follow this rule: it considers negation to be a
>
separate operator with higher precedence than exponentiation, so -3^2
>
comes out to 9, not -9. Some other systems, notably Excel, do this.
It's not, in my opinion, unmanly (or unwomanly) to add parentheses to the
source to tell the compiler what one means. They may be "unneeded"...they
are seldom harmful. "Seldom" because one can certainly imagine an
optimizer which can create "better" code without the redundant parens...so
*maybe* inside a quick loop executed lots of times I'd leave them out.
But my general habit for 47 years or so has been to use the parentheses
when I can't remember the rule in question for *that* language (going back
to CoMIT, at least) in the absence of a compelling reason not to (eg, an
instructor who marks down for them).
--John
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.