<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 Dec 29, 2016, at 16:34, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div></blockquote><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 14px; 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; float: none; display: inline !important;" class="">By that measure there should be no encapsulation; we should make</span><br style="font-family: Helvetica; font-size: 14px; 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;" class=""><span style="font-family: Helvetica; font-size: 14px; 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; float: none; display: inline !important;" class="">everything public, because somebody might need it someday.</span><br style="font-family: Helvetica; font-size: 14px; 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;" class=""><br class=""></div></blockquote></div><div>I don't know what you mean by "encapsulation" but I will explain what I think it means.</div><div><br class=""></div><div><div class="">From Wikipedia <a href="https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)" class="">https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)</a></div><div class=""><div style="margin: 0.5em 0px; line-height: inherit; font-family: sans-serif;" class=""><font color="#804543" class="">In <a href="https://en.wikipedia.org/wiki/Programming_languages" class="mw-redirect" title="Programming languages" style="text-decoration: none; background-image: none;">programming languages</a>, <b class="">encapsulation</b> is used to refer to one of two related but distinct notions, and sometimes to the combination<sup id="cite_ref-1" class="reference" style="line-height: 1; unicode-bidi: -webkit-isolate; white-space: nowrap; font-size: 11.199999809265137px;"><a href="https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29#cite_note-1" style="text-decoration: none; background-image: none;" class="">[1]</a></sup><sup id="cite_ref-Dale_2-0" class="reference" style="line-height: 1; unicode-bidi: -webkit-isolate; white-space: nowrap; font-size: 11.199999809265137px;"><a href="https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29#cite_note-Dale-2" style="text-decoration: none; background-image: none;" class="">[2]</a></sup> thereof:</font></div><ul style="margin: 0.3em 0px 0px 1.6em; padding: 0px; list-style-image: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%225%22%20height%3D%2213%22%3E%0A%3Ccircle%20cx%3D%222.5%22%20cy%3D%229.5%22%20r%3D%222.5%22%20fill%3D%22%2300528c%22%2F%3E%0A%3C%2Fsvg%3E%0A); font-family: sans-serif;" class=""><li style="margin-bottom: 0.1em;" class=""><font color="#804543" class="">A language mechanism for restricting direct access to some of the <a href="https://en.wikipedia.org/wiki/Object_(computer_science)" title="Object (computer science)" style="text-decoration: none; background-image: none;" class="">object</a>'s components.<sup id="cite_ref-3" class="reference" style="line-height: 1; unicode-bidi: -webkit-isolate; white-space: nowrap; font-size: 11.199999809265137px;"><a href="https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29#cite_note-3" style="text-decoration: none; background-image: none;" class="">[3]</a></sup><sup id="cite_ref-Pierce_4-0" class="reference" style="line-height: 1; unicode-bidi: -webkit-isolate; white-space: nowrap; font-size: 11.199999809265137px;"><a href="https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29#cite_note-Pierce-4" style="text-decoration: none; background-image: none;" class="">[4]</a></sup></font></li><li style="margin-bottom: 0.1em;" class=""><font color="#804543" class="">A language construct that facilitates the bundling of data with the <a href="https://en.wikipedia.org/wiki/Method_(computer_programming)" title="Method (computer programming)" style="text-decoration: none; background-image: none;" class="">methods</a> (or other functions) operating on that data.<sup id="cite_ref-5" class="reference" style="line-height: 1; unicode-bidi: -webkit-isolate; white-space: nowrap; font-size: 11.199999809265137px;"><a href="https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29#cite_note-5" style="text-decoration: none; background-image: none;" class="">[5]</a></sup><sup id="cite_ref-6" class="reference" style="line-height: 1; unicode-bidi: -webkit-isolate; white-space: nowrap; font-size: 11.199999809265137px;"><a href="https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29#cite_note-6" style="text-decoration: none; background-image: none;" class="">[6]</a></sup></font></li></ul><div class=""><br class=""></div></div><div class="">Objective C and Smalltalk have encapsulation. iVars are always private. Methods are always callable and "private implementation" is provided by convention (put private methods in private extensions/categories). They do not have compiler enforced access control.</div><div class=""><br class=""></div><div class="">I'm not a fan of compiler enforced access control. It has never helped me out but it has gotten in my way a number of times. There are plenty of ways to do information/implementation hiding without relying on the compiler to play nanny. </div><div class=""><br class=""></div><div class="">My views on what I like in programming languages are largely informed by my years of doing C++, Smalltalk, Java, and Objective C (in that order). </div><div class=""><br class=""></div><div class=""><div class="">Two of those languages I found rigid, frustrating, and limited and I avoid working in them as much as possible. Two of them I find malleable and expressive and seek out opportunities to work in them.</div><div class=""><br class=""></div><div class="">Which is which I leave as an exercise to the reader but the ones I prefer are NOT Java or C++ (although I'm fine with using C++ for limited sized high performance libraries like audio processing units).</div></div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Todd Blanchard</div></div></body></html>