• 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: How the heck do you get records to work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How the heck do you get records to work?


  • Subject: Re: How the heck do you get records to work?
  • From: BJ Terry <email@hidden>
  • Date: Thu, 22 Jan 2004 20:35:49 -0800

On Jan 22, 2004, at 5:27 PM, Christopher Nebel wrote:

If by "anything" you mean "a key-value structure where you're making up keys on the fly", then yes. Records work perfectly well *if* you know ahead of time what all the labels are. However, they're utterly unsuited to doing true associative arrays, a la Perl's hashes. Yes, this is a known feature request.

You are correct, I was making a blanket statement which was not properly qualified (Sometimes I can be as sensationalistic as the L. media). On a related note, I've noticed that it's faster to use a script object with named properties as a drop-in replacement for records. If you run the following script, and then run it with the comment tags removed, the records are slower. They are slower both in creation and access times. On the other hand, records are more syntactically convenient to statically create.

script x
property y : 3
end script

--set x to {y:3}

set myList to {}

set myDate to current date
repeat 5000 times
set end of myList to x's y
end repeat
display dialog ((current date) - myDate)


BJ
_______________________________________________
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.

References: 
 >Fwd: How the heck do you get records to work? (From: Kurt Godden <email@hidden>)
 >Re: How the heck do you get records to work? (From: BJ Terry <email@hidden>)
 >Re: How the heck do you get records to work? (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Scripting 'Terminal'
  • Next by Date: Re: Checking for App running and restart if not
  • Previous by thread: Re: How the heck do you get records to work?
  • Next by thread: Re: Fwd: How the heck do you get records to work?
  • Index(es):
    • Date
    • Thread