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: Deivy Petrescu <email@hidden>
- Date: Mon, 12 May 2003 18:51:45 -0400
On Monday, May 12, 2003, at 17:54 US/Eastern, Emmanuel wrote:
>
At 1:34 PM -0700 12/05/03, Christopher Nebel wrote:
>
> 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.
>
>
>
> There is a bug filed on this.
>
>
What you will do will be well done, Christopher, but I would hardly
>
call that a bug:
>
1. maybe it's not clear for everyone that the unitary negation should
>
have lower precedence than exponentiation (and I don't think that the
>
URL you posted changed many opinions)
>
2. the documentation describes very clearly and accurately how it
>
works, and in the documentation it seems perfectly logical ...
>
>
URL of the table of precedence of arithmetic operators:
>
http://developer.apple.com/techpubs/macosx/Carbon/
>
interapplicationcomm/AppleScript/AppleScriptLangGuide/
>
AppleScript.103.html#31620
>
>
Emmanuel
>
in the name of those who thought that they had read the documentation
>
once for all.
>
>
PS
>
For a more urgent bug to fix, just ask me :-)
>
Chris et al
So, that it is recorded properly, I 100% agree with Emmanuel, and,
given his permission, make mine his words.
I want to add more items to this discussion, AS gives unary
operations precedence over binary.
set foo to false
set foo to not foo and foo
foo --> false
set foo to true
set foo to not foo or foo
foo --> true
Other points; first, the URL deals with algebra, it is not the same
thing!
Unary operations of the type -, is not multiplying by -1 or subtracting
from zero. They are as the name implies unary.
The operation is consistent as it is, i would not call that a bug.
If it is ever "fixed" let us know!
As for bugs... I'll give Emmanuel's precedence over mine ;)
Regards
Deivy Petrescu
http://www.dicas.com/
_______________________________________________
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.