<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">We could do:<br />
<br />
pure let closure = { _-&gt; Else in }<br />
<br />
But given the scope capturing nature of closures I was actually wondering if this 'purity' should be applied to closures.<br />
<br />
After all an inline defined func would do.</div>
<div name="messageSignatureSection"><br /></div>
<div name="messageReplySection"><br />
On Feb 17, 2017, 11:59 AM -0500, Matthew Johnson &lt;matthew@anandabits.com&gt;, wrote:<br />
<blockquote type="cite">How do you suggest a closure indicate its purity? Something like this? &#160;
<div class=""><br class="" /></div>
<div class="">{ pure in $0.property }&#160;
<div class=""><br class="" />
<div>
<blockquote type="cite" class="">
<div class="">On Feb 17, 2017, at 10:57 AM, Florent Vilmart &lt;<a href="mailto:florent@flovilmart.com" class="">florent@flovilmart.com</a>&gt; wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="">
<div name="messageBodySection" class="">We were discussing the topic yesterday with others and some suggested adding a pure keyword, for improved readability, just before the function declaration:<br class="" />
<br class="" />
Ex:<br class="" />
<br class="" />
pure func(a:Some) -&gt; Else {}<br class="" />
<br class="" /></div>
<div name="messageSignatureSection" class=""><br class="" /></div>
<div name="messageReplySection" class=""><br class="" />
On Feb 17, 2017, 11:51 AM -0500, Matthew Johnson via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;, wrote:<br class="" />
<blockquote type="cite" class=""><br class="" />
<div class="">
<blockquote type="cite" class="">
<div class="">On Feb 17, 2017, at 10:46 AM, David Sweeris via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""><br class="Apple-interchange-newline" />
On Feb 17, 2017, at 08:21, Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a>&gt; wrote:<br class="" />
<br class="" /></div>
<blockquote type="cite" style="margin: 15px 0px; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">
<div class="bloop_markdown">
<p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">I haven’t yet read all the feedback in this topic but I’d like to throw some bikeshedding of mine into the room. :)</p>
<p style="margin: 15px 0px;" class="">How about this?</p>
<ul style="margin: 15px 0px;" class="">
<li style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">Version 1:<span class="Apple-converted-space">&#160;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">func(pure) …</code></li>
<li style="margin: 15px 0px;" class="">Version 2:<span class="Apple-converted-space">&#160;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">func label(…) ~&gt; ReturnType</code></li>
</ul>
</div>
</div>
</blockquote>
<span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">Version 2 is going to upset those who use "~&gt;" as an operator.</span>
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""><br class="" /></div>
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="">As the # of possible attributes grows, having an obvious grouping mechanism for them, like version 1, might be worthwhile simply to help make the list clearer. What about allowing "@(list, of, attributes)" instead of "<span style="background-color: rgba(255, 255, 255, 0);" class="">@list, @of, @attributes”?</span></div>
</div>
</blockquote>
<div class=""><br class="" /></div>
<div class="">That would be a little bit awkward for attributes that are parameterized. &#160;And if we did do this we should allow the parens to be omitted when there is only one attribute.</div>
<br class="" />
<blockquote type="cite" class="">
<div class="">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""><span style="background-color: rgba(255, 255, 255, 0);" class=""><br class="" /></span></div>
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">- Dave Sweeris</span></div>
<span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="" />
<span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="" />
<a href="mailto:swift-evolution@swift.org" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="" />
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class="" /></div>
</blockquote>
</div>
<br class="" />
_______________________________________________<br class="" />
swift-evolution mailing list<br class="" />
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="" />
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="" /></blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br class="" /></div>
</div>
</blockquote>
</div>
</body>
</html>