Re: Coerce string to string!?
Re: Coerce string to string!?
- Subject: Re: Coerce string to string!?
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 14 Feb 2002 08:07:15 -0800
On 2/14/02 6:14 AM, "has" <email@hidden> wrote:
>
Paul Berkowitz wrote:
>
>
>> class of i
>
>> --> string (OK)
>
>
>
> That evaluates 'item 1 of {"String"}' to "String" before it gets its class.
>
>
[and]
>
>
> i is a reference ('item 1 of {"String"}'), whereas Original_String is
>
> the string "String" itself. Not the same thing. The equals operator '=' is
>
> extremely particular about such things, whereas other operators such as
>
> 'contains' are happy to evaluate the reference as they go along.
>
>
i.e. It does one thing in one case and something else in another,
>
confounding user expectations every time. (Is there anyone who hasn't been
>
horribly confused by this one at some point?) References are so damn
>
schizophrenic in behaviour- definitely not AppleScript's finest moment.
I agree. I wonder what the rationale or justification for that was meant to
be. I imagine it must have been decided that one single tool - the 'equals'
operator - had to be kept 'pure' for such situations as when one truly
needed to discriminate between reference and object, but that all others
(well almost all others) could be coerced in a user-friendly, "English-like"
fashion. It certainly is confusing when such inconsistencies are allowed to
rule.
--
Paul Berkowitz
_______________________________________________
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.