Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is this?




On Mon, 28 Feb 2005 07:37:35 -0800, Paul Berkowitz wrote:

But why is there a coercible 'text item 2 of "9"' in the first place?

text item 2 of "9"
--> ERROR: Can't get text item 2 of "9"

Whatever is in parentheses is supposed to be executed first. So I wonder why
all the statements, including the 1 * (...), don't error as they should?
That's the bit that's buggy.

Agreed. Just to add further to the confusion (and I don't *think* this has been mentioned yet), there seem to be a couple of ways to change the result - apart from using a different machine/system.


Last night, I tried modifying a series of the quoted integer (0 * (item 2 of "1"), 0 * (item 2 of "2"), etc.) - and was rewarded with a sequence that started:

"1" --> 1.41429518792415E-304
"2" --> 2.82859037584831E-304
"3" --> 4.24288556377246E-304

And the second way to get different results? Today, I tried running the same script and was presented with this:

"1" --> 1.38937436070887E-304
"2" --> 2.77874872141775E-304
"3" --> 4.16812308212662E-304

I find it hard to believe myself that this happened on the same machine. If it didn't, then I'm moving into the advanced stages of senility. Go figure...



BTW, I imagine someone has already tried addition and subtraction, too:

-----------

set l to {}
repeat with n from 0 to 10
	set n to n as string
	set c to count n + 1
	set l's end to {n:n, r:0 + (item c of n)}
end repeat
l

-----------

__> {{n:"0", r:1.38937436070887E-304}, {n:"1", r:1.0}, {n:"2", r:2.0}, {n:"3", r:3.0}, {n:"4", r:4.0}, {n:"5", r:5.0}, {n:"6", r:6.0}, {n:"7", r:7.0}, {n:"8", r:8.0}, {n:"9", r:9.0}, {n:"10", r:10.0}}

- and subtraction:

--> {{n:"0", r:1.38937436070887E-304}, {n:"1", r:-1.0}, {n:"2", r:-2.0}, {n:"3", r:-3.0}, {n:"4", r:-4.0}, {n:"5", r:-5.0}, {n:"6", r:-6.0}, {n:"7", r:-7.0}, {n:"8", r:-8.0}, {n:"9", r:-9.0}, {n:"10", r:-10.0}}

...all of which should error, too.

What would we do without these little diversions to amuse us?  ;-)

---
kai

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.