• 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
String to multiple-item list coercion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

String to multiple-item list coercion


  • Subject: String to multiple-item list coercion
  • From: Steven Angier <email@hidden>
  • Date: Fri, 20 Sep 2002 18:35:28 +1000
  • Organization: Macscript.com

I may choose to live under a nice cosy rock, but I just learned that
strings can be coerced to multiple-item lists:

set {a, b, c, d, e} to "abcdefgh"
return {a, b, c, d, e}
--> {"a", "b", "c", "d", "e"}


Similarly, one can now query a particular item of a string:

item 5 of "abcdefgh"
--> "e"

I was expecting an error: "Can't get item 5 of {"abcdefgh"}." number
-1728


The ASLG (v1.3.7) indicates that this shouldn't work. I think that this
behaviour is a bug or, at best, a bad idea.

Steven Angier
Macscript.com
_______________________________________________
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.

  • Follow-Ups:
    • Too few list items doesn't error [WAS: Re: String to multiple-item list coercion]
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Spaces in file paths under OS X
  • Next by Date: Re: Queuing a Eudora message...
  • Previous by thread: Re: Spaces in file paths under OS X
  • Next by thread: Too few list items doesn't error [WAS: Re: String to multiple-item list coercion]
  • Index(es):
    • Date
    • Thread