Re: Syntax error bug?
Re: Syntax error bug?
- Subject: Re: Syntax error bug?
- From: Cal <email@hidden>
- Date: Thu, 28 Dec 2000 02:14:41 -0500
Allen Watson <email@hidden> wrote:
When constructing a handler with labeled parameters, there can be a "direct
parameter", <optionally> preceded by the words "of" or "in". Both Smile and
Script Editor seem to <require> one or the other word. That is an error, at
least according to the AppleScript Language Guide. Script Editor chokes on
this (supposedly correct) syntax, e.g.:
to removeItem anItem from theList
--code to remove an item from a list
end removeItem
Is this a known bug?
One is forced to use "of" or "in", making for an awkward syntax:
to removeItem of anItem from theList
--code to remove an item from a list
end removeItem
John W Baxter <email@hidden> said:
At 9:47 -0800 12/27/00, Allen Watson wrote:
When constructing a handler with labeled parameters, there can be a "direct
parameter", <optionally> preceded by the words "of" or "in". Both Smile and
Script Editor seem to <require> one or the other word. That is an error, at
least according to the AppleScript Language Guide. Script Editor chokes on
this (supposedly correct) syntax, e.g.:
Script Editor doesn't care at all about the syntax of what you ask it to
have AppleScript compile. It passes AppleScript the text and gets back an
error code, and with luck the compiled code and the decompiled text (which
it displays). (I don't know about Smile)
With that out of the way, yes...it appears that an "in" or "of" is
necessary...at least now. And that doesn't match the modern AppleScript
Language Guide. [I don't remember the dark ages (1993), so I don't know
about early versions of AppleScript.] I don't know whether the Guide or
AppleScript is wrong (or if we're both missing something).
Ah, more history...
[** Why is 1993 considered "the dark ages"? AFAIC, those were exciting times.]
The Guide is wrong. Way back when (1992), it was originally planned
that "of" and "in" were optional, but one of them has always been
required (every version of AppleScript was this way) -- the Guide was
never updated to reflect this.
Cal