<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 25, 2016, at 8:15 PM, Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 25, 2016, at 18:54 , Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 25, 2016, at 6:40 PM, Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Finally caught up. :-) I like this latest version better than the two previous versions, but I kind of think that if behaviors can't emulate "lazy", we've failed. Nothing has a stronger motivation than that at this point in time; there's lots of cool things we <i class="">could</i>&nbsp;use behaviors for, but you can still write all of them with a wrapper type.</div></div></div></blockquote><div class=""><br class=""></div><div class="">Not sure what you mean. It can.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">But you have this in your other message:</div><div class=""><br class=""></div><div class=""><div class=""><div class=""><blockquote type="cite" class="">For now, I'm saying initializer requirements are always "eager" (can't refer to self) and always inline-initialized.</blockquote></div></div><br class=""></div><div class="">Is it really just "can't refer to self" and not actually "eager"?</div></div></div></div></blockquote><div><br class=""></div><div>`lazy var`s still can't refer to self today AFAIK (I know we tried to fix that, but we still get plenty of radars saying it doesn't work…), so I don't think it would be a regression for a behavior implementation not to immediately be able to either. (And I'm not proposing we immediately replace our existing 'lazy' implementation immediately either.)</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">- Someone else brought this up, but can I override behavior methods in a subclass with a new behavior? Can I invoke super's implementation of those behavior methods?</div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">- Can I wrap a superclass property with a behavior? This version of the proposal doesn't have 'base', so I assume the answer is no, but that knocks out the <i class="">other</i>&nbsp;special-case language feature that was to be replaced by the general feature.</div></div></div></blockquote><div class=""><br class=""></div><div class=""><div class="">We're not done yet; this is just version 1. I'm subsetting composition out, since that's also an interesting discussion unto itself. You ultimately ought to be able to wrap a superclass property in new behaviors, but I don't see how you could replace a behavior without violating the superclass's encapsulation. Chaining to super behavior members also feels a bit overly intimate; do you have a use case in mind?</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">willSet or didSet wrapping a superclass setter is not at all uncommon, and the sort of things you wrap with didSet are usually things that want to know about reset() as well.</div></div></div></div></blockquote><div><br class=""></div><div>That's another interesting composition dilemma—if you wrap a property in observers in a subclass, then you'd probably want the base class's 'resettable' behavior to trigger the subclass's observers.</div><div><br class=""></div><div>-Joe</div></div></body></html>