• 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: copy & set statements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy & set statements


  • Subject: Re: copy & set statements
  • From: Timothy Bates <email@hidden>
  • Date: Tue, 23 Oct 2001 10:55:57 +1000

> On 22/10/01 9:25 PM +1000, Doug McNutt, email@hidden, wrote:
>> How anyone can believe that "natural English" is easier than
>> x = a;
>> x = *a;
>> x = &a;

In human those are

Set x to whatever a is
Set x to point to a
Set x to what a points to

In AppleScript

Set x to a
Set x to a reference to a
Copy a to x

The only "trouble" in AppleScript is that this is a few more key strokes and
that x often gets to be a reference without your explicity knowing.

The keystrokes issues is compensated by readability for people who don't
spend 4 hours a day or more reading code or who, like me, have limited short
term memory :-).

The implicit refererenceing and defreferenceing is easily avoided by
habitually using "copy"

Actually, the first book I got (Tao of AppleScript) used this a lot. It was
a good habit that I never learned.

Tim


References: 
 >Re: copy & set statments (From: Shane Stanley <email@hidden>)

  • Prev by Date: Scaling large images w/ Akua Sweets
  • Next by Date: Re: copy & set statements
  • Previous by thread: Re: copy & set statments
  • Next by thread: Re: copy & set statments
  • Index(es):
    • Date
    • Thread