• 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: Month as Integer (or he's ranting again)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Month as Integer (or he's ranting again)


  • Subject: Re: Month as Integer (or he's ranting again)
  • From: Bill Briggs <email@hidden>
  • Date: Sat, 2 Dec 2000 15:15:13 -0300

At 11:58 AM -0500 02/12/00, Marc K. Myers wrote:
What does the "as item" do in this construction? This whole redefinition
of "log" is a great idea and I want to understand it, but I get the same
results with "as item" or without it. I don't find "item" as a value
class in the AppleScript Language Guide, but the compiler accepts it as
a coercion so it must be a value class and not just an element of the
list value class. Or is it?


It's an umbrella that includes objects or values of different classes. In the Finder you can easily see how "item" is a catch-all. Assuming you have 10 items on your desktop, just run this in Script Editor with the event log open and observe what is returned.

tell application "Finder"
repeat with i from 1 to 10
get class of item i of desktop
end repeat
end tell

None of those things are of class "item", because there isn't one. They are of class trash-object, disk, folder, alias file, etc.

In other contexts "item" includes other things. In a list, the particular "item" has a class of whatever it happens to be; string, integer, real, alias, etc. It can be of any class, or it can be an expression that includes members of several classes. As far as the list is concerned an item is just some arbitrary member of the list that's addressable by it's index (all of the reference forms for a list just point to members by location), but for the purpose of addressing it, its actual value class is of no particular consequence.

As you pointed out, the "as item" does nothing in that construction.

- web


  • Follow-Ups:
    • Re: Month as Integer (or he's ranting again)
      • From: Emmanuel <email@hidden>
References: 
 >Re: Month as Integer (or he's ranting again) (From: "Marc K. Myers" <email@hidden>)

  • Prev by Date: Re: Month as Integer (or he's ranting again)
  • Next by Date: Parent path. Senility?
  • Previous by thread: Re: Month as Integer (or he's ranting again)
  • Next by thread: Re: Month as Integer (or he's ranting again)
  • Index(es):
    • Date
    • Thread