Re: is this a bug?
Re: is this a bug?
- Subject: Re: is this a bug?
- From: "Arthur J. Knapp" <email@hidden>
- Date: Tue, 06 Aug 2002 14:57:20 -0400
>
Date: Tue, 06 Aug 2002 17:25:43 +0100
>
Subject: Re: is this a bug?
>
From: Mr Tea <email@hidden>
>
This from Arthur J. Knapp - dated 6-8-02 03.50 pm:
>
> This most likely indicates the AppleScript compiler has delayed evaluation of
>
> the first operand until it has understood it's relationship to the rest of
>
> the
>
> line, which is why you are getting a coercion error rather than an
>
> out-of-bounds error.
>
Well whaddaya know. That's exactly what I was trying to say, Arthur. Only
>
you sound like you know what you're talking about. ;-)
Given that I am not a programmer, it does sound pretty good, doesn't it?
;-)
From what I've read, compilers follow several conceptual steps,
the first of which is to break the source code apart into "tokens".
Following tokenization, "operators" have to be found and considered
first, to ensure that a language's "order of operations" is followed.
Consider:
set s to "123"
(item 4 of s) + 1 / 0 --> error "Can't divide 1.0 by zero."
Despite the fact that "item 4 of s" is going to error out, it
is the division operation that occurs first, presumably because
it's order of operation is greater than that of evaluating
AppleScript references, ie: "sometihng of something". It is
different when we do this:
set s to "123"
(item 4 of s) / 0 --> error "Can't get item 4 of "123"."
Now that the reference has to be evaluated in order for
the operator to do it's thing, the reference error occurs
first, before it realizes that a division by zero is occuring.
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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.