• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can someone explain this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can someone explain this?


  • Subject: Re: Can someone explain this?
  • From: "email@hidden" <email@hidden>
  • Date: Fri, 20 Mar 2009 22:31:46 -0700


I can't comment on excluding/including the "the," except to say that, any language that depends on an English article being used or not used to determine the interpretation is lacking in clarity of language design. Moreover, if the "the" MUST be used in some places, MUST NOT be used in other places, and is OPTIONAL in still other places, well--that's a recipe for disaster, in my book. Ideally, the "the" should be optional everywhere, even if removing it everywhere makes the program read like it's been written in some kind of broken, Pidgin English. Broken English or not, it should still do what it's supposed to do, and what the programmer expected it to do.


The "the' behavior in this thread has been in place for some time and has only recently been noticed, there are effective workarounds. But, it is a bug and should be fixed.

This bug is a compiler bug, where the behavior that a corrects a badly formed reference to the "last item" or "end of" so it can be used as part of a range, is broken when the word "the" is added.

end of mylist
and
last item of mylist

are both commands that in any other context return the value of the last item of a list. The compiler is clever enough to realize that in this context

items 1 thru last item of mylist
and
items 1 thru the end of mylist

the scripter intended to refer to the index of the last item rather than the value. The "the" simply confuses the compiler so it reverts to the standard behavior. Very simply and plainly it's a small bug in the compiler that should be easy to fix.

The easiest solution would be for applescript to not fix the error but instead generate a compile error. The better solution is to fix this rather obscure bug.

But don't confuse this bug with cases where "the" is required. Those cases are not in the basic language. One example is in a finder command (the clipboard) another case is in Jon's commands "the ticks" and there are a few cases sprinkled though a number of applications and osax where a command or a parameter uses the word "the" and in those cases it is required.

AppleScript is a dynamic language and applications and osax add terminology to the language and those terms may contain "the".

But, those have nothing to do with this bug. They are coincidental.

 ES

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Can someone explain this?
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Can someone explain this? (From: "Nigel Garvey" <email@hidden>)
 >Re: Can someone explain this? (From: Philip Aker <email@hidden>)
 >Re: Can someone explain this? (From: "email@hidden" <email@hidden>)
 >Re: Can someone explain this? (From: Bruce Brown <email@hidden>)

  • Prev by Date: Re: How to extract the domain of an email address
  • Next by Date: Re: Can someone explain this?
  • Previous by thread: Re: Can someone explain this?
  • Next by thread: Re: Can someone explain this?
  • Index(es):
    • Date
    • Thread