> On Aug 9, 2016, at 08:24 , Karl wrote:
>
>
>> On 3 Aug 2016, at 02:01, Rick Mann via swift-users
>> wrote:
>>
>> It complains if I make it a let because computed properties must be var.
>> Because it's a protocol, it can't be stored (even though
> On 3 Aug 2016, at 02:01, Rick Mann via swift-users
> wrote:
>
> It complains if I make it a let because computed properties must be var.
> Because it's a protocol, it can't be stored (even though it can be stored in
> the conforming type).
>
> If I make it { get },
On Mon, Aug 8, 2016 at 6:16 PM, Rick Mann wrote:
>
> > On Aug 3, 2016, at 03:23 , Dan Loewenherz wrote:
> >
> > On Wed, Aug 3, 2016 at 3:51 AM, Rick Mann via swift-users <
> swift-users@swift.org> wrote:
> >
> > > On Aug 2, 2016, at 19:06 , Jordan
> On Aug 3, 2016, at 03:23 , Dan Loewenherz wrote:
>
> On Wed, Aug 3, 2016 at 3:51 AM, Rick Mann via swift-users
> wrote:
>
> > On Aug 2, 2016, at 19:06 , Jordan Rose wrote:
> >
> > I don’t think it makes sense to do this.
On Wed, Aug 3, 2016 at 3:51 AM, Rick Mann via swift-users <
swift-users@swift.org> wrote:
>
> > On Aug 2, 2016, at 19:06 , Jordan Rose wrote:
> >
> > I don’t think it makes sense to do this. A protocol cannot control how a
> particular property is implemented (stored or
> On Aug 2, 2016, at 19:06 , Jordan Rose wrote:
>
> I don’t think it makes sense to do this. A protocol cannot control how a
> particular property is implemented (stored or computed), and any conforming
> type must initialize all of its stored properties before
Oh, it's a computed property! Got it, I thought you meant its value was
computed in the init and never changed again.
Sent from my iPhone
> On Aug 2, 2016, at 19:01, Rick Mann wrote:
>
> It complains if I make it a let because computed properties must be var.
> Because
It complains if I make it a let because computed properties must be var.
Because it's a protocol, it can't be stored (even though it can be stored in
the conforming type).
If I make it { get }, I can't set it in the extensions init() method.
I guess I could make it private set (not sure of the
If I understand things correctly, you *can* make uuid a let because you’re
allowed to set them (once) during init functions.
- Dave Sweeris
> On Aug 2, 2016, at 6:22 PM, Rick Mann via swift-users
> wrote:
>
> I'm trying to define a protocol that has a read-only,
I'm trying to define a protocol that has a read-only, immutable member "uuid"
that can be set in the init() method, but I'm having trouble. I have this:
protocol
Element
{
var uuid : { get }
}
extension
Element
{
init(...)
{
self.uuid = ...
}
}
I can't make it let,
10 matches
Mail list logo