• 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: bug in rest of list?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in rest of list?


  • Subject: Re: bug in rest of list?
  • From: JJ <email@hidden>
  • Date: Tue, 05 Feb 2002 21:51:02 +0100

> I discovered what may be a bug. Consider this code (AS 1.7 with Standard
> Additions 1.6):
>
> set x to {"&&&&", "===="}
> set y to rest of x
> --> y should be {"===="}
>
> set z to class of y
> display dialog z as string
> --> list (as expected)
>
> set z to count y
> display dialog z as string
> -- > 1 (as expected)
>
> try
> display dialog y as integer -- deliberately err
> on error errmsg
> display dialog errmsg -- y looks like a string!
> end try
>
> Any explanations forthcoming?

Sorry, I'm running AS 1.3.7 but, where is the bug?
> --> y should be {"===="}
Is it or not? Log window?
> --> list (as expected)
OK
> --> 1 (as expected)
OK
> -- y looks like a string
If you receive the dialog: << Can't convert "====" into a string >>,
then there isn't a bug, but a single string list is coerced to a string
automatically, a list of strings can _be_coerced_ to string, and a list
without records, too.

Try this:

set x to {"Hello!"}
display dialog x

set y to {"Hello, ", "Dolly"}
display dialog y as string

set z to {"Hello, ", "Dolly", {1, 2.25, "k"}}
display dialog z as string

JJ


  • Prev by Date: Re: comparing two identical strings
  • Next by Date: Re: Multiple Buttons
  • Previous by thread: Re: bug in rest of list?
  • Next by thread: Re: Re: bug in rest of list?
  • Index(es):
    • Date
    • Thread