• 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: associative lists [was Re: Choose from list]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: associative lists [was Re: Choose from list] (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Answer to the "._" files question
  • Next by Date: file format backwards compatibility question
  • Previous by thread: Re: associative lists [was Re: Choose from list]
  • Next by thread: Re: crop left half of image via script / iMagine Photo
  • Index(es):
    • Date
    • Thread