• 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
Re: What is this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is this?


  • Subject: Re: What is this?
  • From: kai <email@hidden>
  • Date: Mon, 28 Feb 2005 20:31:19 +0000


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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: What is this?
      • From: Doug McNutt <email@hidden>
    • Re: What is this?
      • From: deivy petrescu <email@hidden>
  • Prev by Date: Re: Removing html tags
  • Next by Date: Re: Pseudo-regexp
  • Previous by thread: Re: What is this?
  • Next by thread: Re: What is this?
  • Index(es):
    • Date
    • Thread