> On Dec 22, 2015, at 12:51 PM, Guillaume Lessard via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> Hi,
> 
> Regardless of anything else in the proposal, I strongly dislike its attempted 
> subversion of `let` properties.
> 
> struct A {
>  let member = 1 // It’s done, over. If that’s not what you want, don’t 
> initialize it here.
> }
> 

This is not an attempt to subvert `let` properties.  The `= 1` in the 
declaration can very reasonably be viewed as a default value that should be 
used if the member is not otherwise initialized.

Why would you have an immutable instance member that is always going to have a 
constant value of 1?  That just wastes space by duplicating the constant value 
in many instances.  However it is quite reasonable to have an immutable 
instance member that defaults to 1, but may have a different value depending on 
the initializer that is used for the instance.

Matthew
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to