Re: String to multiple-item list coercion
Re: String to multiple-item list coercion
- Subject: Re: String to multiple-item list coercion
- From: Steven Angier <email@hidden>
- Date: Fri, 27 Sep 2002 00:32:16 +1000
On 26/9/02 9:28 PM, "has" <email@hidden> wrote:
>
set {a, b, c, d, e} to "abcdefgh"
>
Meanwhile:
>
>
set {day:a, month:b, year:c} to date "Sunday, September 1, 2002
>
12:00:00am"
>
If we follow Steven's original logic that a multiple assignment with list
>
on left and string on right invokes an atypical item->list invisible
>
coercion, then by extension there must be an invisible date->record
>
coercion happening in my date example as well.
Non sequitur. I am not sure how you make that leap with your date-property,
multiple-assignment record example. It has nothing to do with the string
"coercion/multiple assignment" behaviour I originally mentioned. Your date
example explicitly gets several properties of the date object (day, month,
year). My string example was different; it queried no properties; it asked
for no elements. Expecting my string example to get the results it does
means one should also expect:
set {a,b,c} to date "Sunday, September 1, 2002 12:00:00am"
return {a,b,c}
--> {"September", 1, 2002}
Or, maybe:
set {a,b,c} to 123
return {a,b,c}
--> {1, 2, 3}
Also, your use of records to catch assigned values is nothing new. It has
been a documented feature of the language since the beginning, but it is so
awkward that it is rarely seen.
>
I'm NOT trying to be rude or condescending to anyone. However, aside from
>
making a fair point about 'item of "some string"' not being documented, I
>
thought Steven's assessment was flawed and wrong, and unhelpful and
>
potentially misleading to anyone else reading this thread.
I think you flatter us both by presuming anyone impressionable is bothering
to reading this thread.
BTW: its not documented because its a bug; and the bug is that a string can
be coerced to a list of items.
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.