• 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: More Swift issues, NSURLComponents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More Swift issues, NSURLComponents


  • Subject: Re: More Swift issues, NSURLComponents
  • From: Rick Mann <email@hidden>
  • Date: Mon, 05 Oct 2015 18:59:35 -0700

> On Oct 5, 2015, at 18:47 , Charles Srstka <email@hidden> wrote:
>
>> On Oct 5, 2015, at 8:19 PM, Rick Mann <email@hidden> wrote:
>>
>>> On Oct 5, 2015, at 18:12 , Jens Alfke <email@hidden <mailto:email@hidden>> wrote:
>>>
>>> NSURLComponents is a class, not a struct, so ‘url3’ is a reference, not a value, and ‘let’ just means you can’t reassign ‘url3’ to point to another object.
>>
>> But it wasn't allowed in the copy() case.
>
> That’s because it doesn’t *know* it’s a class in the copy() case. An AnyObject could be a class *or* a struct. The compiler errs on the side of caution.

Huh. I continue to be bothered by the ambiguity/variability of "let"*. Is the reference immutable or the thing it points to? I wish I could specify which is important in the code I'm writing. And I'm not sure I like the different treatment for structs, although I can accept it.

*Okay, maybe it's not ambiguous, but it often seems to be the opposite of what I want.

--
Rick Mann
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: More Swift issues, NSURLComponents
      • From: Jens Alfke <email@hidden>
    • Re: More Swift issues, NSURLComponents
      • From: Charles Srstka <email@hidden>
References: 
 >More Swift issues, NSURLComponents (From: Rick Mann <email@hidden>)
 >Re: More Swift issues, NSURLComponents (From: Jens Alfke <email@hidden>)
 >Re: More Swift issues, NSURLComponents (From: Rick Mann <email@hidden>)
 >Re: More Swift issues, NSURLComponents (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: More Swift issues, NSURLComponents
  • Next by Date: Re: More Swift issues, NSURLComponents
  • Previous by thread: Re: More Swift issues, NSURLComponents
  • Next by thread: Re: More Swift issues, NSURLComponents
  • Index(es):
    • Date
    • Thread