Re: How the heck do you get records to work?
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.