• 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: fun with records and keywords
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fun with records and keywords


  • Subject: Re: fun with records and keywords
  • From: Brennan <email@hidden>
  • Date: Thu, 18 Oct 2001 20:59:35 +0200

has <email@hidden> wrote:



> I found the following oddly amusing (maybe I've been at the computer too
> long...?):
>
> set x to {class:string, contents:"test"}
>
> get class of x
> --> string
>
> get contents of x
> --> "test"
>
> It looks like my properties are overriding the object's own when I query
> them. Bizarre. Is that what's expected?
>
> Useful? Safe to use?

Yes. This is acceptable and expected. Sort of.

It's not smart to create a new structure and give it a class property which has the same value as an existing class, because things can get very confusing. 'Real' strings can do a whole bunch of other things that your little record can't. Your call.

However, there's nothing to stop you defining the 'class' of a record or script object. Some purists might even say it's good practice to provide a 'class' property with every custom structure. (I never heard anyone say this, but I can imagine it happening).

>From ASLG:

"The Class property of a record can be modified it is not read-only".

(page 75)

-brennan


  • Prev by Date: Re: AppleScript Suite
  • Next by Date: Re: To Script, or not to Script?
  • Previous by thread: Re: fun with records and keywords
  • Next by thread: Re: fun with records and keywords
  • Index(es):
    • Date
    • Thread