Re: Understanding a repeat loop (strings/characters)
Re: Understanding a repeat loop (strings/characters)
- Subject: Re: Understanding a repeat loop (strings/characters)
- From: John W Baxter <email@hidden>
- Date: Sun, 23 Feb 2003 17:48:00 -0800
- Envelope-to: email@hidden
At 9:37 +1100 2/24/2003, Steven Angier wrote:
>
On 23/2/03 12:35 PM, "has" <email@hidden> wrote:
>
>
> ...And since in strings 'item' is synonymous
>
> with 'character', what you end up with is a reference to each
>
> character.
>
>
It is a shame that 'item' is not synonymous with 'text item'.
I don't see it that way.
"Text item" takes interpretation of the contents of the string, item
doesn't (beyond the ability to recognize what one character means in the
multi-byte case).
I think both capabilities are useful...making item synonymous with text
item would remove the simpler case from the language, requiring the use of
"character" and making strings less like lists.
It also would mean that one would have to be even more careful to reset
TIDs to the list of one null string instantly when finished with some other
TID value.
In an alternative initial definition of the language, in which text items
don't exist and therefore neither do text item delimiters, one might write
set aList to aString as list using aDelimiter [as [the] delimiter]
and set aString to aList as string using aDelimiter [as [the] delimiter]
That would be more shell/Perl/awk/sed/Python/whatever-like (cf split at the
higher level, and %, #, %%, ## and friends in shell string processing).
Jon P...did a form like that get considered in the early days?
(I've forgotten what HyperTalk may have had.)
It's also important to remember that in the early days, at least, the use
of "item" probably descended in part from the fact that the AEList
descriptor type has items, and that usage of item probably stuck. (I know,
we're supposed to ignore the contents of the block pointed to by the handle
in the AEDesc...THAT's no fun!...but "item" is exposed in the API, too.)
--John
--
John W. Baxter Port Ludlow, WA, USA
set emptyRecord to {behindTheCurtain: "Pay no attention to the string
behind the curtain!"}
_______________________________________________
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.