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

Re: set vs copy?


  • Subject: Re: set vs copy?
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 15 Sep 2010 21:22:49 +1000
  • Thread-topic: set vs copy?

On 15/9/10 6:13 PM, "Nigel Garvey" <email@hidden>
wrote:

> Chris Nebel told me on this list a few years ago that 'copy' only makes
> copies of mutable objects. With immutable data, it behaves exactly the
> same way as 'set'. The reason it takes slightly longer over it is that,
> being 'copy', it has to work out first whether the objects are mutable or not.

That makes sense as an optimisation. Now that we're talking implementation
details, he's bound to break in...
>
> I suspect, but don't know for sure, that this means 'copy' only
> duplicates the _structures_ of mutable objects, which are pointers in
> the same way that variables are. There's actually no need to duplicate
> the values contained by those objects.

I think Hamish said it does a deep copy, although I could be
mis-remembering.


--
Shane Stanley <email@hidden>



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

This email sent to email@hidden

References: 
 >Re: set vs copy? (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: Illustrator CS4 hierarchical menus
  • Next by Date: Re: set vs copy?
  • Previous by thread: Re: set vs copy?
  • Next by thread: Re: set vs copy?
  • Index(es):
    • Date
    • Thread