<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 Feb 18, 2016, at 6:56 PM, Joe Groff via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Based on review feedback, I've revised the declaration syntax proposal for property behaviors to be more in line with our other declaration forms, reverting to the earlier pre-review "var behavior" proposal. I've updated the proposal in swift-evolution:<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0030-property-behavior-decls.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0030-property-behavior-decls.md</a></div></blockquote></div></div></blockquote><div><br class=""></div><div>The updated behavior declaration form is largely an improvement. </div><div><br class=""></div><div>With the placeholder for binding the name of the attributed property gone from the grammar, I wonder if you’ve given any thought to how that binding might be done. I recognize that the binding is left for future work, but would hate to see my pet feature painted into a corner.</div><div><br class=""></div><div>I find the naked `initialValue` “declaration" quite odd. It’s not exactly a declaration even. What are the implications for parsing? If we’re already willing to special case`initialValue` in the parser in this context, perhaps we could introduce a binding list instead, like:</div><div><br class=""></div><div>```</div><div><div>public var behavior lazy<Value>: Value {</div><div> // Behaviors can bind the property's initializer expression with a</div><div> // binding declaration.</div><div> bind initialValue</div><div> …</div></div><div>```</div><div>Besides eliminating the odd naked “declaration”, this has the added advantage that it could be extended to `bind initialValue, propertyName`. :-)</div><div><br class=""></div><div>Also, the initialValue in the “Proposed Solution” section doesn’t match the naked syntax used throughout the Examples section.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">In discussion with the core team, we've also strongly come in favor of applying behaviors to properties using attribute syntax, e.g.:<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">@lazy var x = 111</div><div class="">@delayed var x: Int</div><div class=""><br class=""></div></blockquote>They're definitely attribute-like, and we think it makes sense for behaviors to be the first of hopefully many kinds of user-defined behaviors. What do you all think of this direction?</div></div></blockquote><div><br class=""></div><div>I think this is an excellent direction. Would we also use @ syntax for accessing property-supplied members, like `<a href="mailto:a@runcible.x" class="">a@runcible.x</a>`?</div><div><br class=""></div><div><div>Cheers,</div><div><br class=""></div><div>Curt</div><div>-----------------------------------------------------------------------------</div><div>Curt Clifton, PhD</div><div>Software Engineer</div><div>The Omni Group</div><div><a href="http://www.curtclifton.net" class="">www.curtclifton.net</a></div><div class=""><br class=""></div></div><div><br class=""></div><div><br class=""></div><div><br class=""></div></div></body></html>