Re: associative lists [was Re: Choose from list]
Re: associative lists [was Re: Choose from list]
- Subject: Re: associative lists [was Re: Choose from list]
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 22 Jul 2005 16:17:47 -0400
On 7/21/05, Emmanuel <email@hidden> wrote:
AppleScript's records have something unique (unless I'm missing
something), they implement the asymmetric concatenation, an
invaluable powerful magic feature.
Asymmetric concatenation means that you're able to composit records
with conflicting fields, yes? The result is interesting:
{a: 1, b: 2, c:3 } & { c: 2, d: 4, e: 6} = { a:1, b: 2, c: 3, d: 4, e: 6}
So the leftmost occurrence of a given field wins; is that what makes AS
unique here? In a Perl hash concatenation, the rightmost would
win. Python and Ruby don't support concatenation of
dictionaries/hashes per se, although they do support an update() method
that will import a second one into the first one, but it explicitly
overwrites any preexisting values - so again, effectively, the
rightmost wins.
--
Mark J. Reed <
email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden