• 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: A Syntax Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Syntax Question


  • Subject: Re: A Syntax Question
  • From: Ted Wrigley <email@hidden>
  • Date: Tue, 08 Jul 2014 12:58:22 -0700

ok, maybe it’s easiest to turn the problem around. applescript seems to be coercing the left-hand side ot the comparison to a list.  in other words:

"a" is in {"a", "b", "c”} becomes {“a"} is in {"a", "b", "c”}
1 is in {1, 2, 3} becomes {1} is in {1, 2, 3}

Since trying to coerce a list into a list leaves it unchanged - {5, 3} stays as {5, 3} - {5, 3} is in {{4, 2}, {5, 3}, {6, 4}} returns false, because no subset of the main list contains a 5 and a 3. the left-hand list has to be explicitly presented as a list of lists - {{5, 3}} - in order to force a search for a contained list rather than for a direct subset of the main list.

Note that the following returns true: {5, 3} is in {{4, 2}, {6, 4}, 5, 3}

In other words, it actually seems to make sense. go figure.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: A Syntax Question
  • Next by Date: Re: A Syntax Question
  • Previous by thread: Re: A Syntax Question
  • Next by thread: Script won't run consistently
  • Index(es):
    • Date
    • Thread